get_env_pres {S4DM} | R Documentation |
Extract presence data for SDM fitting.
Description
This function extracts presence data at known presence records.
Usage
get_env_pres(coords, env, env_bg = NULL)
Arguments
coords |
Coordinates (long,lat) to extract values for |
env |
Environmental SpatRaster(s) in any projection |
env_bg |
Background data produced by |
Value
A list containing 1) the environmental data at the presence locations (env), and 2) an sf data.frame containing the occurrence records(occurrence_sf).
Examples
{
# 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)
}
[Package S4DM version 0.0.1 Index]