Join cell_id data from sdm_area to a occurrences
Details
This function is key in this SDM workflow. It attaches cell_id values to occ
, deletes
records outside pred
and allows the use of pseudoabsences. This function also tests if
CRS from both occ
and pred
are equal, otherwise the CRS of pred
is used to
convert occ
.
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.