Climate and Productivity

Website

What data do we have?

We have weather stations at the following points:

Show the code
map <- tar_read(plot_geoms) + 
  geom_point(data = tar_read(climate_dat), aes(x = Longitude..x., y = Latitude..y.))

map

Finding the region names:

Upload a geojson file to find the region names.

Unfortunatly, the datasets themselves aren’t stored on github, and so are not accesable unless you prebake them e.g. with a ggplot object. I can’t easily do that with an {ojs} block, so you need to provide the .geojson file yourself!

Viewing Time Series Data:

Show the code
color_scheme_set(scheme = "teal")


dat_trunc <- tar_read(climate_dat) %>%
  # filter(Date.Time < "Jan 1999") %>%
  filter(Station.Name == "BROMPTONVILLE")

p <- ggplot(data = dat_trunc, aes(x = Month,
                                  y = Snow.Grnd.Last.Day..cm.,
                                  color = Year,
                                  group = Year)) +
  geom_point() +
  geom_line() + 
  theme_default() +
  scale_color_viridis(option = "inferno") + 
  ggtitle("Change in Mean Temp Over Time")


p

Climate Data

We have the following parameters in the climate dataset:

Just lat, lon.

Gives name of weather station. See also: Date.Time.

I don’t know what this is yet. Someone should find out

  • Jason

Not all the stations have coverage throughout the entire range.

Show the code
ggplot(dat_a, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `A` Names") +
  theme_default()

Show the code
d1 <- filter(dat_b, substr(Station.Name, 2, 2) < "N")
d2 <- filter(dat_b, substr(Station.Name, 2, 2) >= "N")

p1 <- ggplot(d1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `B` Names") +
  theme_default()

p2 <- ggplot(d2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `B` Names") +
  theme_default()

p1

Show the code
p2

Show the code
c1 <- filter(dat_c, substr(Station.Name, 2, 2) < "N")
c2 <- filter(dat_c, substr(Station.Name, 2, 2) >= "N")

ggplot(c1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `C` Names") +
  theme_default()

Show the code
ggplot(c2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `C` Names") +
  theme_default()

Show the code
d1 <- filter(dat_d, substr(Station.Name, 2, 2) < "N")
d2 <- filter(dat_d, substr(Station.Name, 2, 2) >= "N")

ggplot(d1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `D` Names") +
  theme_default()

Show the code
ggplot(d2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `D` Names") +
  theme_default()

Show the code
e1 <- filter(dat_e, substr(Station.Name, 2, 2) <= "Z")

ggplot(e1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `E` Names") +
  theme_default()

Show the code
f1 <- filter(dat_f, substr(Station.Name, 2, 2) < "N")
f2 <- filter(dat_f, substr(Station.Name, 2, 2) >= "N")

ggplot(f1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `F` Names") +
  theme_default()

Show the code
ggplot(f2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `F` Names") +
  theme_default()

Show the code
g1 <- filter(dat_g, substr(Station.Name, 2, 2) < "N")
g2 <- filter(dat_g, substr(Station.Name, 2, 2) >= "N")

ggplot(g1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `G` Names") +
  theme_default()

Show the code
ggplot(g2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `G` Names") +
  theme_default()

Show the code
h1 <- filter(dat_h, substr(Station.Name, 2, 2) < "N")
h2 <- filter(dat_h, substr(Station.Name, 2, 2) >= "N")

ggplot(h1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `H` Names") +
  theme_default()

Show the code
ggplot(h2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `H` Names") +
  theme_default()

Show the code
i1 <- filter(dat_i, substr(Station.Name, 2, 2) <= "N")

ggplot(i1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `I` Names") +
  theme_default()

Show the code
j1 <- filter(dat_j, substr(Station.Name, 2, 2) <= "Z")

ggplot(j1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `J` Names") +
  theme_default()

Show the code
k1 <- filter(dat_k, substr(Station.Name, 2, 2) <= "Z")

ggplot(k1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `K` Names") +
  theme_default()

Show the code
l1 <- filter(dat_l, substr(Station.Name, 2, 2) < "N")
l2 <- filter(dat_l, substr(Station.Name, 2, 2) >= "N")

ggplot(l1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `L` Names") +
  theme_default()

Show the code
ggplot(l2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `L` Names") +
  theme_default()

Show the code
m1 <- filter(dat_m, substr(Station.Name, 2, 2) < "N")
m2 <- filter(dat_m, substr(Station.Name, 2, 2) >= "N")

ggplot(m1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `M` Names") +
  theme_default()

Show the code
ggplot(m2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `M` Names") +
  theme_default()

Show the code
n1 <- filter(dat_n, substr(Station.Name, 2, 2) < "N")
n2 <- filter(dat_n, substr(Station.Name, 2, 2) >= "N")

ggplot(n1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `N` Names") +
  theme_default()

Show the code
ggplot(n2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `N` Names") +
  theme_default()

Show the code
o1 <- filter(dat_o, substr(Station.Name, 2, 2) < "N")
o2 <- filter(dat_o, substr(Station.Name, 2, 2) >= "N")

ggplot(o1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `O` Names") +
  theme_default()

Show the code
ggplot(o2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `O` Names") +
  theme_default()

Show the code
p1 <- filter(dat_p, substr(Station.Name, 2, 2) < "N")
p2 <- filter(dat_p, substr(Station.Name, 2, 2) >= "N")

ggplot(p1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `P` Names") +
  theme_default()

Show the code
ggplot(p2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `P` Names") +
  theme_default()

Show the code
q1 <- filter(dat_q, substr(Station.Name, 2, 2) <= "Z")

ggplot(q1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `O` Names") +
  theme_default()

Show the code
r1 <- filter(dat_r, substr(Station.Name, 2, 2) <= "Z")

ggplot(r1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `R` Names") +
  theme_default()

Show the code
s1 <- filter(dat_s, substr(Station.Name, 2, 2) <= "P")
s2 <- filter(dat_s, (substr(Station.Name, 2, 2) > "P") & (substr(Station.Name, 2, 2) <= "T"))
s3 <- filter(dat_s, substr(Station.Name, 2, 2) > "T")


ggplot(s1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `S` Names") +
  theme_default()

Show the code
ggplot(s2, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `S` Names") +
  theme_default()

Show the code
ggplot(s3, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `S` Names") +
  theme_default()

Show the code
t1 <- filter(dat_t, substr(Station.Name, 2, 2) <= "Z")

ggplot(t1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `T` Names") +
  theme_default()

Show the code
u1 <- filter(dat_u, substr(Station.Name, 2, 2) <= "Z")

ggplot(u1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `U` Names") +
  theme_default()

Show the code
v1 <- filter(dat_v, substr(Station.Name, 2, 2) <= "Z")

ggplot(v1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `V` Names") +
  theme_default()

Show the code
w1 <- filter(dat_w, substr(Station.Name, 2, 2) <= "Z")

ggplot(w1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `W` Names") +
  theme_default()

Note: No X names.

Show the code
x1 <- filter(dat_x, substr(Station.Name, 2, 2) <= "Z")

ggplot(x1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `X` Names") +
  theme_default()

Show the code
y1 <- filter(dat_y, substr(Station.Name, 2, 2) <= "Z")

ggplot(y1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `Y` Names") +
  theme_default()

Note: there are no Z names.

Show the code
z1 <- filter(dat_z, substr(Station.Name, 2, 2) <= "Z")

ggplot(z1, aes(x = Date.Time, y = Station.Name)) + 
  geom_line() +
  ggtitle("Coverage — `Z` Names") +
  theme_default()

Also don’t know what this is yet, but I can guess…

Show the code
dat_trunc <- tar_read(climate_dat) %>%
  # filter(Date.Time < "Jan 1999") %>%
  filter(Station.Name == "MAGOG")

p <- ggplot(data = dat_trunc, aes(x = Month,
                                  y = Mean.Max.Temp...C.,
                                  color = Year,
                                  group = Year)) +
  geom_point() +
  geom_line() + 
  theme_default() +
  scale_color_viridis(option = "inferno") + 
  ggtitle("Change in Mean Max Temp Over Time — MAGOG")


p

Productivity Data