View source: R/calculate_covariates.R
calculate_temporal_dummies | R Documentation |
Calculate temporal dummy covariates at point locations. Returns a
data.frame
object with locs_id
, year binary variable for each
value in year
, and month and day of week binary variables.
calculate_temporal_dummies(
locs,
locs_id = "site_id",
year = seq(2018L, 2022L),
geom = FALSE,
...
)
locs |
data.frame with a temporal field named |
locs_id |
character(1). Unique site identifier column name.
Default is |
year |
integer. Year domain to dummify.
Default is |
geom |
FALSE/"sf"/"terra".. Should the function return with geometry?
Default is |
... |
Placeholders. |
a data.frame or SpatVector object
Insang Song
## 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_temporal_dummies(
locs = loc,
locs_id = "id",
year = seq(2018L, 2022L)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.