shannon: Shannon's Index or Entropy

View source: R/indicators.R

shannonR Documentation

Shannon's Index or Entropy

Description

Compute entropy according to Shannon (1948)

Usage

shannon(.data = NULL, taxon, count, base = 2)

shannon_(.data = NULL, taxon, count, base = 2)

Arguments

.data

data in a data.frame, tibble, data.table, database etc.

taxon

taxa names (character)

count

counts (numeric)

base

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

Value

Shannon's entropy

Functions

  • shannon_(): version suitable for calling from a function (see package lazyeval).

References

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

Examples

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


benthos documentation built on Aug. 22, 2022, 5:07 p.m.