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
calculate_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", "mcd14ml", "prism",
"cropscape", "cdl", "huc", "edgar", "goes", "goes_adp", "GOES", "drought", "spei",
"eddi", "usdm"),
from,
locs,
locs_id = "site_id",
.by_time = NULL,
weights = NULL,
...
)Arguments
- covariate
character(1). Covariate type.
- from
character, SpatRaster, SpatVector, or data.frame depending on the selected
covariateroute.- 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".- .by_time
NULL or character(1). Name of the time column to use temporal summarization unit token.
NULL(default) disables temporal summarization.- weights
NULL,SpatRaster, polygonSpatVector/sf, or file path. Passed through to the underlying source-specific function for weighted extraction. IfNULL(default), unweighted extraction is performed.- ...
Arguments passed to each covariate calculation function.
See also
calculate_modis: "modis", "MODIS"calculate_koppen_geiger: "koppen-geiger", "koeppen-geiger", "koppen"calculate_ecoregion: "ecoregion", "ecoregions"calculate_temporal_dummies: "dummies", "Dummies"calculate_hms: "hms", "smoke", "HMS"calculate_gmted: "gmted", "GMTED"calculate_narr: "narr", "NARR"calculate_geos: "geos", "geos_cf", "GEOS"calculate_goes: "goes", "goes_adp", "GOES"calculate_population: "population", "sedac_population"calculate_groads: "roads", "groads", "sedac_groads"calculate_nlcd: "nlcd", "NLCD"calculate_tri: "tri", "TRI"calculate_nei: "nei", "NEI"calculate_merra2: "merra", "MERRA", "merra2", "MERRA2"calculate_gridmet: "gridMET", "gridmet"calculate_terraclimate: "terraclimate", "TerraClimate"calculate_prism: "prism", "PRISM"calculate_cropscape: "cropscape", "cdl"calculate_huc: "huc", "HUC"calculate_edgar: "edgar"calculate_drought: "drought", "spei", "eddi", "usdm"
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)
calculate_covariates(
covariate = "narr",
from = narr, # derived from process_covariates() example
locs = loc,
locs_id = "id",
geom = FALSE
)
} # }