Diversity index, one of shannon, simpson or
invsimpson.
MARGIN
Margin for which the index is computed.
base
The logarithm base used in shannon.
Value
Vector of diversity indices.
Details
Shannon or Shannon--Weaver (or Shannon--Wiener) index is defined as
$H' = -\sum_i p_i \log_{b} p_i$, where
$p_i$ is the proportional abundance of species $i$ and $b$
is the base of the logarithm. It is most popular to use natural
logarithms, but some argue for base $b = 2$ (which makes sense, but no
difference).
Both variants of Simpson's index are based on $S = \sum p_i^2$. Choice simpson returns $1-S$ and
invsimpson returns $1/S$.