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()
library(concaveman)
concaveman(fires)
## Simple feature collection with 1 feature and 0 fields
## Geometry type: POLYGON
## Dimension:     XY
## Bounding box:  xmin: -138.7299 ymin: 56.0654 xmax: -93.7668 ymax: 69.0612
## Geodetic CRS:  WGS 84
##                         polygons
## 1 POLYGON ((-138.7289 66.0893...