get_env_pres | R Documentation |
This function extracts presence data at known presence records.
get_env_pres(coords, env, env_bg = NULL)
coords |
Coordinates (long,lat) to extract values for |
env |
Environmental SpatRaster(s) in any projection |
env_bg |
Background data produced by |
A list containing 1) the environmental data at the presence locations (env), and 2) an sf data.frame containing the occurrence records(occurrence_sf).
{
# load in sample data
library(S4DM)
library(terra)
# occurrence points
data("sample_points")
occurrences <- sample_points
# environmental data
env <- rast(system.file('ex/sample_env.tif', package="S4DM"))
# rescale the environmental data
env <- scale(env)
env_pres <- get_env_pres(coords = occurrences,
env = env)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.