| spaccFunc | R Documentation |
Compute spatial accumulation of functional diversity metrics based on traits.
spaccFunc(
x,
coords,
traits,
metric = c("fdis", "fric"),
n_seeds = 50L,
method = "knn",
distance = c("euclidean", "haversine"),
parallel = TRUE,
n_cores = NULL,
progress = TRUE,
seed = NULL,
map = FALSE
)
x |
A site-by-species matrix (abundance data recommended). |
coords |
A data.frame with columns |
traits |
A species-by-traits matrix. Row names should match species (columns of x). |
metric |
Character vector. Metrics to compute:
|
n_seeds |
Integer. Number of random starting points. Default 50. |
method |
Character. Accumulation method. Default |
distance |
Character. Site distance method: |
parallel |
Logical. Use parallel processing? Default |
n_cores |
Integer. Number of cores. |
progress |
Logical. Show progress? Default |
seed |
Integer. Random seed. |
map |
Logical. If |
Functional diversity metrics quantify trait space occupation:
FDis (Functional Dispersion): Abundance-weighted mean distance from the community centroid in trait space. Captures functional divergence.
FRic (Functional Richness): Volume of trait space occupied (convex hull). Requires more species than traits to compute.
An object of class spacc_func containing:
curves |
Named list of matrices, one per metric (n_seeds x n_sites) |
metric |
Metrics computed |
coords, n_seeds, n_sites, method |
Parameters used |
Laliberté, E. & Legendre, P. (2010). A distance-based framework for measuring functional diversity from multiple traits. Ecology, 91, 299-305.
FD::dbFD() for comprehensive functional diversity analysis
coords <- data.frame(x = runif(50), y = runif(50))
species <- matrix(rpois(50 * 20, 2), nrow = 50)
# Trait matrix (species x traits)
traits <- matrix(rnorm(20 * 3), nrow = 20)
rownames(traits) <- paste0("sp", 1:20)
colnames(species) <- rownames(traits)
func <- spaccFunc(species, coords, traits, metric = c("fdis", "fric"))
plot(func)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.