This function creates a new input_sdm
object.
Value
A input_sdm
object containing:
- grid
sf
with POLYGON geometry representing the grid for the study area or LINESTRING ifsdm_area
was built with a LINESTRINGsf
.- bbox
Four corners for the bounding box (class
bbox
): minimum value of X, minimum value of Y, maximum value of X, maximum value of Y- cell_size
numeric
information regarding the size of the cell used to rescale variables to the study area, representing also the cell size in thegrid
.- epsg
character
information about the EPSG used in all slots fromsdm_area
.- predictors
character
vector with predictors names included insdm_area
.
Details
If sdm_area
is used, it can include predictors and scenarios. In this case,
input_sdm
will detect and include as scenarios
and predictors
in the
input_sdm
output. Objects can be included in any order, since the function will work by
detecting their classes.
The returned object is used throughout the whole workflow to apply functions.
Examples
# Create sdm_area object:
sa <- sdm_area(parana, cell_size = 50000, crs = 6933)
#> ! Making grid over study area is an expensive task. Please, be patient!
#> ℹ Using GDAL to make the grid and resample the variables.
# Include predictors:
sa <- add_predictors(sa, bioc) |> select_predictors(c("bio1", "bio4", "bio12"))
#> ! Making grid over the study area is an expensive task. Please, be patient!
#> ℹ Using GDAL to make the grid and resample the variables.
# Include scenarios:
sa <- add_scenarios(sa, scen)
# Create occurrences:
oc <- occurrences_sdm(occ, crs = 6933) |> join_area(sa)
#> Warning: Some records from `occ` do not fall in `pred`.
#> ℹ 3 elements from `occ` were excluded.
#> ℹ If this seems too much, check how `occ` and `pred` intersect.
# Create input_sdm:
i <- input_sdm(oc, sa)