allindices: Functions for calculating diversity, evenness and dominance...

View source: R/allindices.R

allindicesR Documentation

Functions for calculating diversity, evenness and dominance indices.

Description

Functions for calculating shannon, simpson, margalef, menhinick, pielou and other indices. A convenient function for calculating all the indices simultaneously is provided.

Usage

allindices(x, tax_lev = "Taxa", base = exp(1))

berpar(x, tax_lev = "Taxa")

brill(x, tax_lev = "Taxa")

esimpson(x, tax_lev = "Taxa")

fisher(x, tax_lev = "Taxa")

invberpar(x, tax_lev = "Taxa")

invsimpson(x, tax_lev = "Taxa")

margalef(x, tax_lev = "Taxa")

mcintosh(x, tax_lev = "Taxa")

menhinick(x, tax_lev = "Taxa")

pielou(x, base = exp(1), tax_lev = "Taxa")

shannon(x, base = exp(1), tax_lev = "Taxa")

simpson(x, tax_lev = "Taxa")

Arguments

x

Result of aggregate_taxa().

tax_lev

Taxonomic level at which the calculation has to be performed.

base

The base of the logarithm for indices with log transformation.

Details

Shannon index:

H'=-\sum_{i=1}^{S} p_{i}\log(p_{i})

Pielou index:

J'=\frac{H'}{\log(S)}

Margalef diversity:

D_{mg}=\frac{(S - 1)}{\log(N)}

Menhinick diversity:

D_{mn}=\frac{S}{\sqrt(N)}

Brillouin index:

HB=\frac{\log(N) -\sum(\log(n_{i})) }{N}

Simpson's index is calculated as D. biomonitoR returns 1 - D and 1/D when index is set to simpson() or invsimpson().

D=\sum_{i=1}^{S} p_{i}^{2}

Simpson's evenness:

D_{1/D}=\frac{1/D}{\sqrt(S)}

Berger-Parker index:

d=\frac{N_{max}}{N}

The inverse of this index is also provided with invberpar(). McIntosh's diversity:

D=\frac{N-U}{N-\sqrt(N)}

where

U=\sqrt(\sum_{i=1}^{S} n_{i}^{2})

Fisher alpha is calculated as follow:

\alpha=\frac{N(1-x)}{x}

where x is estimated from the iterative solution of:

\frac{S}{N}=-\frac{N(1-x)}{x} \log(1-x)

p_i is the proportion of individuals found in the i-th species, n_i is the number of individuals found in the i-th species, S the species richness, N the number of individuals and N_max the number of individuals in the most abundant species. All the indices are calculated according to Magurran (2004).

Functions

  • berpar: Berger-Parker index

  • brill: Brillouin index

  • esimpson: Simpson's evenness

  • fisher: Fisher alpha

  • invberpar: Inverse Berger-Parker

  • invsimpson: Inverse Simpson

  • margalef: Margalef diversity index

  • mcintosh: McIntosh dominance index

  • menhinick: Menhinick index

  • pielou: Pielou's evenness index

  • shannon: Shannon index

  • simpson: Simpson's Index of Diversity

References

Magurran, A. E. (2004). Measuring biological diversity. Blackwell Science ltd.

See Also

aggregate_taxa

Examples

data(macro_ex)
data_bio <- as_biomonitor(macro_ex)
data_agr <- aggregate_taxa(data_bio)
allindices(data_agr)
shannon(data_agr)

# base 2
shannon(data_agr, base = 2)

alexology/biomonitoR documentation built on April 7, 2024, 10:15 a.m.