Learn R Programming

benthos (version 2.0-0)

shannon: Shannon's Index or Entropy

Description

Compute entropy according to Shannon (1948)

Usage

shannon(taxon, count, base = 2)

Value

Shannon's entropy

Arguments

taxon

taxa names (character)

count

counts (numeric)

base

the base with respect to which logarithms are computed. Defaults to 2 (unit: bits).

References

Shannon, C. E., 1948. A Mathematical Theory of Communication. Bell System Technical Journal 27: 379-423.

Examples

Run this code
 shannon(
     taxon = c("Euspira pulchella", "Nephtys cirrosa"),
     count = c(4, 6)
 )

Run the code above in your browser using DataLab