calc_ecoregion {amadeus} | R Documentation |
Calculate ecoregions covariates
Description
Extract ecoregions covariates (U.S. EPA Ecoregions Level 2/3) at point
locations. Returns a data.frame
object containing locs_id
and
binary (0 = point not in ecoregion; 1 = point in ecoregion) variables for
each ecoregion.
Usage
calc_ecoregion(from = NULL, locs, locs_id = "site_id", geom = FALSE, ...)
Arguments
from |
SpatVector(1). Output of |
locs |
sf/SpatVector. Unique locs. Should include
a unique identifier field named |
locs_id |
character(1). Name of unique identifier. |
geom |
logical(1). Should the function return a |
... |
Placeholders. |
Value
a data.frame or SpatVector object object with dummy variables and attributes of:
-
attr(., "ecoregion2_code")
: Ecoregion lv.2 code and key -
attr(., "ecoregion3_code")
: Ecoregion lv.3 code and key
Author(s)
Insang Song
See Also
Examples
## 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)
calc_ecoregion(
from = ecoregion, # derived from process_ecoregion() example
locs = loc,
locs_id = "id",
geom = FALSE
)
## End(Not run)
[Package amadeus version 1.0.7 Index]