Closed mikejohnson51 closed 3 years ago
exactextractr::exact_extract()
does better then what I had started! No need for me to go further. Here is an example for others:
library(AOI)
library(climateR)
library(dplyr)
library(exactextractr)
library(raster)
library(sf)
counties = aoi_get(state = "conus", county = "all")
param = c("tmax", "tmin", "prcp", "srad")
s = getTerraClim(counties,
param = param,
startDate = "2018-06-01") %>%
stack() %>%
setNames(param)
dat = cbind(counties, exact_extract(s, counties, "mean", progress = FALSE))
d3 = dplyr::select(dat, starts_with("mean"))
plot(d3, border = NA)
Created on 2020-10-19 by the reprex package (v0.3.0)
Further, move beyond just mean to provide SD, VAR, RANGE options for statistic