View source: R/functional_divergence.R
functional_divergence | R Documentation |
Calculates functional divergence from a species-trait matrix and possibly an abundance vector. Weights should only be supplied, when using 'gower'=TRUE.
functional_divergence(
x,
w,
a = rep(1, nrow(x)),
ch = T,
gower = T,
detailed = F
)
x |
numeric matrix. Species-trait matrix. |
w |
numeric vector. A vector of length equal to columns in 'x', which specifies the variable weights. If missing, weights are equal. |
a |
optional numeric vector. Species-abundances. |
ch |
optional numeric or logical. Should the center of be based on the convex hull of the species, if true the convex hull is estimated on a 2-D PCoA. If a numeric the convex hull is estimateds on a N-D PCoA. |
gower |
a logical. Calculate entropy based on Gower dissimilarity as opposed to euclidean distance. |
detailed |
a logical. If true the partial divergences and convex hull vertices are returned. |
a number. Or if 'detailed'=TRUE, a list containing; the community functional divergences, the partial divergences and a boolean indicating whether a species is in the set of convex hull vertices for all present species in each site (missing values are missing species).
This functions implements functional divergence as it is defined in \insertCiteVilleger2008asgerbachelor. It handles both euclidean distance and Gower dissimilarity (however not with ordered factors or asymmetric binary variables).
The argument 'ch' defines a maximum trait dimensionality, which will be lowered on a site by site basis, if the number of species is lower than the number of (ordinated) traits. OBS: If 'ch'=FALSE, then no convex hull will be calculated, and instead all site-present species will be used for center of mass calculation.
Villeger2008asgerbachelor
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.