Learn R Programming

RAM (version 1.2.1.3)

diversity.indices: Calculate True Diversity and Evenness

Description

These functions calculate true diversity and evenness for all samples.

Usage

true.diversity(data, index = "simpson") evenness(data, index = "simpson")

Arguments

data
a list of otu tables to be processed. See RAM.input.formatting.
index
the index to use for calculations; partial match to "simpson" or "shannon".

Value

Both functions return a numeric data frame, where the rows are the given OTUs, and the columns are the samples.

Details

For the following sections, $S$ represents the number of species, $\lambda$ represents the Simpson index, and $H'$ represents the Shannon index.

The formulas for the true diversity of the indices are as follows:

  • Simpson: $D_2 = 1 / \lambda$
  • Shannon: $D_1 = exp(H')$

The formulas for the evenness of the indices are as follows:

  • Simpson: $(1 / \lambda)/ S$
  • Shannon: $H' / ln(S)$

References

Jari Oksanen, F. Guillaume Blanchet, Roeland Kindt, Pierre Legendre, Peter R. Minchin, R. B. O'Hara, Gavin L. Simpson, Peter Solymos, M. Henry H. Stevens and Helene Wagner (2013). vegan: Community Ecology Package. R package version 2.0-10. http://CRAN.R-project.org/package=vegan

Diversity index. (2014, May 7). In Wikipedia, The Free Encyclopedia. Retrieved 14:57, May 28, 2014, from http://en.wikipedia.org/w/index.php?title= Diversity_index&oldid=607510424

Blackwood, C. B., Hudleston, D., Zak, D. R., & Buyer, J. S. (2007) Interpreting ecological diversity indices applied to terminal restriction fragment length polymorphism data: insights from simulated microbial communities. Applied and Environmental Microbiology, 73(16), 5276-5283.

Examples

Run this code
data(ITS1, ITS2)
# true diversity, using default index (Simpson)
true.diversity(data=list(ITS1=ITS1))
# true diversity for ITS1 and ITS2, using Shannon
true.diversity(data=list(ITS1=ITS1, ITS2=ITS2), index="shannon")
# default evenness (Simpson) for ITS1/ITS2
evenness(data=list(ITS1=ITS1, ITS2=ITS2))
# Shannon evenness
evenness(data=list(ITS1=ITS1), index="shannon")

Run the code above in your browser using DataLab