Description Usage Arguments Value Note Author(s) Examples
View source: R/ShannonDiversity.R
Calculates a number of metrics based on the Shannon information entropy measure of diversity in a vector, x.
1 |
x |
1 x n vector. |
H |
Shannon entropy-based metric of diversity. This captures the effects of both richnes (the length of the vector, n) and the evenennes of the distribution. |
Hmax |
The maximum possible value of H given a vector of the length n provided. |
Hr |
Relative evenness Hr = H/Hmax |
Hcentral |
The centralization or concentration of the values among the n elements |
n |
Number of elements in the vector. |
effective.n |
effective number of elements in the vector, given the distribution of the relative weights. |
The formulation for Shannon Diversity uses a natural logarithm. As the natural logarithm of zero is undefined, the input vector cannot contain zeros. Analytically, there are two approaches to dealing with this issue if your vector contains zeros. First, you can apply the analysis to only the non-zero elements. Second, you can add a tiny amount to all of the elements such that the zero elements are now very small numbers, relative the original vector values.
Stuart R. Borrett
1 2 3 4 5 6 7 8 9 | data(oyster)
## throughflow diversity
T <- enaFlow(oyster)$T
ShannonDiversity(T)
## storage (biomass) biodiversity
## X <- oyster %v% "storage"
## ShannonDiversity(X)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.