View source: R/calculate_covariates.R
calculate_covariates | R Documentation |
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()
.
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"),
from,
locs,
locs_id = "site_id",
...
)
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 |
character(1). Name of unique identifier.
Default is |
... |
Arguments passed to each covariate calculation function. |
Calculated covariates as a data.frame or SpatVector object
covariate
argument value is converted to lowercase.
Insang Song
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_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"
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
## amount of data which is not included in the package.
## Not run:
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
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.