
Generate Candidate Sites for Alternative Site Selection
Source:R/alternative_sites.R
ss_alt_candidates.RdGenerates a pool of candidate sites (random or on a systematic grid)
within a raster's extent, restricted to valid (non-NA) cells, and
extracts their environmental values.
Usage
ss_alt_candidates(
raster_data,
n_candidates,
method = c("random", "systematic"),
spacing = NULL,
seed = NULL
)Arguments
- raster_data
A
SpatRasterstack of environmental covariates.- n_candidates
Integer, number of candidate sites to generate.
- method
"random"(default) or"systematic"(regular grid).- spacing
Numeric, grid spacing for
method = "systematic"(in raster coordinate units). IfNULL(default), calculated from the raster extent to approximaten_candidates.- seed
Optional integer seed for reproducibility.
Examples
if (FALSE) { # \dontrun{
r <- terra::rast("data/predictors.tif")
candidates <- ss_alt_candidates(r, n_candidates = 1000, seed = 123)
} # }