Generates sampling points at the centroids of compact geographical strata. This is purposive sampling designed for optimal spatial coverage.
Usage
ss_coverage(
x,
n_strata = NULL,
prior_points = NULL,
n_try = 1L,
n_cells = 2500L,
verbose = FALSE
)Arguments
- x
An
sfobject representing the study area, OR anss_strataobject fromss_stratify().- n_strata
Integer, number of strata (and samples) to create. Only used if
xis an sf object.- prior_points
Optional
sfobject with prior sampling locations.- n_try
Integer, number of random initializations (default 1).
- n_cells
Integer, approximate number of grid cells (default 2500).
- verbose
Logical, whether to print progress (default FALSE).
Value
An object of class ss_samples containing:
- samples
An
sfobject with sampling points at stratum centroids.- method
Character, "coverage".
- n_samples
Integer, number of samples.
- strata
The stratification object.
- crs
The coordinate reference system.
Details
Spatial coverage sampling places sampling points at the centroids of compact geographical strata. This is optimal for model-based inference (kriging) as it provides even spatial coverage.
If a centroid falls outside the study area boundary, it is moved to the nearest cell center within the corresponding stratum.
Examples
if (FALSE) { # \dontrun{
library(sf)
poly <- st_polygon(list(rbind(c(0, 0), c(100, 0), c(100, 50), c(0, 50), c(0, 0))))
study_area <- st_sf(geometry = st_sfc(poly))
# Direct usage
samples <- ss_coverage(study_area, n_strata = 25, n_try = 5)
# Or using pre-computed strata
strata <- ss_stratify(study_area, n_strata = 25, n_try = 5)
samples <- ss_coverage(strata)
} # }
