The calculate_covariates()
function extracts values at point
locations from a SpatRaster or SpatVector object returned from
process_covariates()
. calculate_covariates()
and the underlying
source-specific covariate functions have been designed to operate on the
processed objects. To avoid errors, do not edit the processed
SpatRaster or SpatVector objects before passing to
calculate_covariates()
.
Usage
calc_covariates(
covariate = c("modis", "koppen-geiger", "koeppen-geiger", "koppen", "koeppen", "geos",
"dummies", "gmted", "sedac_groads", "groads", "roads", "ecoregions", "ecoregion",
"hms", "smoke", "gmted", "narr", "geos", "sedac_population", "population", "nlcd",
"merra", "merra2", "gridmet", "terraclimate", "tri", "nei"),
from,
locs,
locs_id = "site_id",
...
)
Arguments
- covariate
character(1). Covariate type.
- from
character. Single or multiple from strings.
- locs
sf/SpatVector. Unique locations. Should include a unique identifier field named
locs_id
- locs_id
character(1). Name of unique identifier. Default is
"site_id"
.- ...
Arguments passed to each covariate calculation function.
See also
calc_modis_par
: "modis", "MODIS"calc_koppen_geiger
: "koppen-geiger", "koeppen-geiger", "koppen"calc_ecoregion
: "ecoregion", "ecoregions"calc_temporal_dummies
: "dummies", "Dummies"calc_hms
: "hms", "smoke", "HMS"calc_gmted
: "gmted", "GMTED"calc_narr
: "narr", "NARR"calc_geos
: "geos", "geos_cf", "GEOS"calc_sedac_population
: "population", "sedac_population"calc_sedac_groads
: "roads", "groads", "sedac_groads"calc_nlcd
: "nlcd", "NLCD"calc_tri
: "tri", "TRI"calc_nei
: "nei", "NEI"calc_merra2
: "merra", "MERRA", "merra2", "MERRA2"calc_gridmet
: "gridMET", "gridmet"calc_terraclimate
: "terraclimate", "TerraClimate"
Examples
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
if (FALSE) { # \dontrun{
loc <- data.frame(id = "001", lon = -78.90, lat = 35.97)
calc_covariates(
covariate = "narr",
from = narr, # derived from process_covariates() example
locs = loc,
locs_id = "id",
geom = FALSE
)
} # }