Extract Raster Values at Location of Sites
Value
A data.frame
with average environmental values (columns) per site
(rows), with the first column being "site"
indicating site names.
Examples
## Import climate rasters ----
prec <- system.file("extdata", "annual_tot_prec.tif", package = "funbiogeo")
tavg <- system.file("extdata", "annual_mean_temp.tif", package = "funbiogeo")
layers <- terra::rast(c(tavg, prec))
fb_get_environment(head(woodiv_locations), layers)
#> site annual_mean_temp annual_tot_prec
#> 1 26351755 NaN NaN
#> 2 26351765 16.44746 495
#> 3 26351955 16.08605 671
#> 4 26351965 NaN NaN
#> 5 26451755 16.66498 495
#> 6 26451765 16.39656 517