Results

Map

Number of fire points per year

fires %>% st_drop_geometry() %>%  group_by(year) %>% summarise(number=n()) %>% ggplot(aes(x=year,y=number)) +geom_line()

boxplot distance from tree line

fires %>% ggplot(aes(x=as.factor(year),y=distance)) +geom_boxplot()

Maximum temperatures

library(dygraphs)
library(xts)

climate %>% filter(element=="TMAX") %>% mutate(value=value/10) %>% dplyr::select(date,id,value) %>% pivot_wider(names_from = "id",values_from = value) ->cl
cl<-xts(cl[,-1],cl$date)
dygraph(cl) %>%dyLegend(show="never") 

Running average for station CA002202801

TAVG

Precipitation

Yearly precipitation

library(lubridate)
climate %>% filter(element=="PRCP") %>% dplyr::select(date,value, id) ->cl
cl %>% filter(date >dmy("03-01-2006"))->cl
cl %>% mutate(year=lubridate::year(date)) %>% group_by(year,id) %>% summarise(n=n(),sum(value/10)) %>% dt()