shannon: Shannon's Biodiversity Index

Description Usage Arguments Value Note Author(s) Examples

Description

Calculates Shannon's Biodiversity Index on a single column of relative abundance data. This metric takes into account both richness and evenness.

Usage

1

Arguments

sample

A vector of relative abundance data, typically a single column in a matrix

Value

Returns a single number indicating the amount of biodiversity in the tested sample

Note

Use apply functions to calculate Shannon's index for all samples in a matrix

Author(s)

Alexandra Linz <amlinz16@gmail.com>

Examples

1
2
data(otu_table)
richness <- apply(otu_table, 2, shannon)

OTUtable documentation built on May 1, 2019, 10:51 p.m.