shannon | R Documentation |
Computes Shannon's and equitability indices
shannon(vect, base=2)
vect |
a probability vector whose sum = 1 or a frequency vector |
base |
logarithm base used (default=2) |
Computes Shannon's and equitability indices. The vector passed can be a probability vector whose sum equal 1 or a vector of frequencies (e.g. the number of food item of each category).
A vector of two values: Shannon's and equitability indices. The base logarithm used is stored as attribute
shannonbio
x<-c(0.1,0.5,0.2,0.1,0.1)
sum(x)
shannon(x)
x<-rpois(10,6)
shannon(x, base=exp(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.