Description Usage Arguments Details Value References Examples
View source: R/simpson_evenness.R
Measure evenness using Simpson's evenness
1 | simpson_even(x, na.rm = FALSE)
|
x |
a vector of abundances or some other numbers for which evenness is to be measured |
na.rm |
if TRUE, NA values will be removed before computing Simpson's evenness |
This function implements the Simpson's evenness metric. For a description of Simpson diversity, see Magurran & McGill (2011) Box 5.1 p. 57. "D = sum over p_i^2 gave the probability that two individuals drawn at random from an infinite community would belong to the same species. ... As such, D is the inverse of diversity.... The most common way of converting homogeneity into diversity is D = 1/D." Simpson evenness is scaled 0 to 1 by dividing Simpson diversity by species richness (or number of hectads in my case).
Simpson_e = (1 / sumOver(p_i)^2) / S
where S is number of observed species (or number of hectads) and p_i is the proportion of abundance for species i (p_i = N_i/N)
the Simpson's evenness value for x
Magurran, Anne E. and Brian J. McGill. 2011. Biological Diversity: Frontiers in Measurement and Assessment. Oxford University Press.
1 2 3 4 5 6 7 | dat <- c(1, 5, 3, 2, 2, 2, 1) # data with uneven values
dat2 <- c(5, 5, 4, 2, 2, 2, 1) # data with more even values
simpson_even(dat)
simpson_even(dat2) # Simpson's evenness value is higher for more even data
# Simpson's evenness is insensitive to number of observations
identical(simpson_even(dat), simpson_even(c(dat, dat)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.