| spacc | R Documentation |
Compute species accumulation curves using various spatial sampling methods with C++ backend for performance.
spacc(
x,
coords,
n_seeds = 50L,
method = c("knn", "kncn", "random", "radius", "gaussian", "cone", "collector"),
distance = c("euclidean", "haversine"),
backend = c("auto", "exact", "kdtree"),
support = NULL,
include_halo = TRUE,
sigma = NULL,
cone_width = pi/4,
parallel = TRUE,
n_cores = NULL,
progress = TRUE,
groups = NULL,
time = NULL,
w_space = 1,
w_time = 1,
seed = NULL,
order = NULL
)
x |
A site-by-species matrix (rows = sites, cols = species) with presence/absence (0/1) or abundance data. Can also be a data.frame. |
coords |
Site coordinates. Can be:
|
n_seeds |
Integer. Number of random starting points for uncertainty quantification. Default 50. |
method |
Character. Accumulation method:
|
distance |
Character. Distance method: |
backend |
Character. Nearest-neighbor backend for
|
support |
Optional. Spatial support for core/halo classification via
|
include_halo |
Logical. When |
sigma |
Numeric. Bandwidth for Gaussian method. Default auto-calculated. |
cone_width |
Numeric. Half-width in radians for cone method. Default pi/4. |
parallel |
Logical. Use parallel processing? Default |
n_cores |
Integer. Number of cores. Default |
progress |
Logical. Show progress bar? Default |
groups |
Optional. A factor, character, or integer vector of length
|
time |
Optional. Numeric vector of length |
w_space |
Numeric. Weight for spatial distance when |
w_time |
Numeric. Weight for temporal distance when |
seed |
Integer. Random seed for reproducibility. Default |
order |
Optional user-defined accumulation order(s). When supplied,
|
When groups = NULL, an object of class spacc containing:
curves |
Matrix of cumulative species counts (n_seeds x n_sites) |
coords |
Original coordinates |
n_seeds |
Number of seeds used |
method |
Method used |
n_species |
Total species in dataset |
Arrhenius, O. (1921). Species and area. Journal of Ecology, 9, 95-99.
Scheiner, S.M. (2003). Six types of species-area curves. Global Ecology and Biogeography, 12, 441-447.
Chiarucci, A., Bacaro, G., Scheiner, S.M. (2011). Old and new challenges in using species diversity for assessing biodiversity. Philosophical Transactions of the Royal Society B, 366, 2426-2437.
coords <- data.frame(x = runif(50), y = runif(50))
species <- matrix(rbinom(50 * 30, 1, 0.3), nrow = 50)
# Basic usage
sac <- spacc(species, coords)
plot(sac)
# Different methods
sac_knn <- spacc(species, coords, method = "knn")
sac_rand <- spacc(species, coords, method = "random")
comp <- compare(sac_knn, sac_rand)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.