Learn R Programming

amadeus (version 1.3.2.1)

calculate_huc: Calculate HUC covariates

Description

Extract HUC IDs at point locations. Returns a data.frame object containing locs_id and HUC IDs.

Usage

calculate_huc(from, locs, locs_id = "site_id", geom = FALSE, ...)

Value

a data.frame or SpatVector object

Arguments

from

SpatVector(1). Output from process_huc().

locs

data.frame. character to file path, SpatVector, or sf object.

locs_id

character(1). Column within locations CSV file containing identifier for each unique coordinate location.

geom

FALSE/"sf"/"terra".. Should the function return with geometry? Default is FALSE, options with geometry are "sf" or "terra". The coordinate reference system of the sf or SpatVector is that of from.

...

Placeholders.

Author

Insang Song

See Also

process_huc()

Examples

Run this code
## NOTE: Example is wrapped in `\dontrun{}` as function requires a large
##       amount of data which is not included in the package.
if (FALSE) {
loc <- data.frame(id = "001", lon = -78.90, lat = 35.97)
calculate_huc(
  from = huc, # derived from process_huc() example
  locs = loc,
  locs_id = "id",
  geom = FALSE
)
}

Run the code above in your browser using DataLab