Reduce spatial autocorrelation by subsampling sites using various methods.
Usage
subsample(
coords,
n = NULL,
method = c("grid", "random", "thinning"),
cell_size = NULL,
min_dist = NULL,
seed = NULL
)Arguments
- coords
A data.frame with columns
xandycontaining site coordinates.- n
Integer. Target number of sites to retain. If
NULL, determined bycell_sizeormin_dist.- method
Character. Subsampling method:
"grid"(default),"random", or"thinning".- cell_size
Numeric. Grid cell size for
method = "grid". One site retained per cell.- min_dist
Numeric. Minimum distance between retained sites for
method = "thinning".- seed
Integer. Random seed for reproducibility.
Details
Methods:
"grid": Overlay a grid and retain one random site per cell."random": Simple random subsample of n sites."thinning": Iteratively remove sites until minimum distance is achieved.
References
Aiello-Lammens, M.E., Boria, R.A., Radosavljevic, A., et al. (2015). spThin: an R package for spatial thinning of species occurrence records for use in ecological niche models. Ecography, 38, 541-545.
Lennon, J.J., Koleff, P., Greenwood, J.J.D. & Gaston, K.J. (2004). Contribution of rarity and commonness to patterns of species richness. Ecology Letters, 7, 81-87.