| spaccMetrics | R Documentation |
Compute spatial accumulation metrics for each site as a starting point. Useful for identifying sites with high or low accumulation rates, visualizing spatial patterns in diversity, and understanding edge effects.
spaccMetrics(
x,
coords,
metrics = c("slope_10", "half_richness", "auc"),
method = c("knn", "kncn", "random"),
distance = c("euclidean", "haversine"),
parallel = TRUE,
n_cores = NULL,
progress = TRUE
)
x |
A site-by-species matrix (rows = sites, cols = species). |
coords |
A data.frame with columns |
metrics |
Character vector. Metrics to compute. Options include:
|
method |
Character. Accumulation method: |
distance |
Character. Distance method: |
parallel |
Logical. Use parallel processing? Default |
n_cores |
Integer. Number of cores for parallel processing. |
progress |
Logical. Show progress bar? Default |
This function runs a spatial accumulation curve starting from each site individually, then extracts summary metrics from each curve. This allows you to identify:
Sites in species-rich areas (high initial slope)
Core vs edge sites (fast vs slow accumulation)
Spatial patterns in community structure
The metrics can be plotted as a heatmap using plot(result, type = "heatmap"),
which requires the ggplot2 package. For more sophisticated spatial
visualization with study area boundaries, see the areaOfEffect package.
An object of class spacc_metrics containing:
metrics |
Data frame with one row per site and columns for each metric |
coords |
Original coordinates |
metric_names |
Names of computed metrics |
n_sites |
Number of sites |
n_species |
Total species count |
Soberon, J.M. & Llorente, J.B. (1993). The use of species accumulation functions for the prediction of species richness. Conservation Biology, 7, 480-488.
spacc() for standard accumulation curves
coords <- data.frame(x = runif(50), y = runif(50))
species <- matrix(rbinom(50 * 30, 1, 0.3), nrow = 50)
metrics <- spaccMetrics(species, coords,
metrics = c("slope_10", "auc"))
metrics$metrics$slope_10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.