View source: R/calculate_covariates.R
calculate_terraclimate | R Documentation |
Extract TerraClimate values at point locations. Returns a data.frame
object containing locs_id
and TerraClimate variable. TerraClimate
variable column name reflects the TerraClimate variable and
circular buffer radius. The $time
column will contain the year and month
("YYYYMM") as TerraClimate products have monthly temporal resolution.
calculate_terraclimate(
from = NULL,
locs = NULL,
locs_id = NULL,
radius = 0,
fun = "mean",
geom = FALSE,
...
)
from |
SpatRaster(1). Output from |
locs |
data.frame. character to file path, SpatVector, or sf object. |
locs_id |
character(1). Column within |
radius |
integer(1). Circular buffer distance around site locations. (Default = 0). |
fun |
character(1). Function used to summarize multiple raster cells
within sites location buffer (Default = |
geom |
FALSE/"sf"/"terra".. Should the function return with geometry?
Default is |
... |
Placeholders. |
a data.frame or SpatVector object
TerraClimate data has monthly temporal resolution, so the $time
column
will contain the year and month in YYYYMM format (ie. January, 2018 =
201801).
Mitchell Manware
process_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_terraclimate(
from = terraclimate, # derived from process_terraclimate() example
locs = loc,
locs_id = "id",
radius = 0,
fun = "mean",
geom = FALSE
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.