simpson {abdiv} | R Documentation |
Simpson's index and related measures
Description
These measures are based on the sum of squared species proportions. The
function dominance()
gives this quantity, simpson()
gives one
minus this quantity, invsimpson()
gives the reciprocal of the
quantity, and simpson_e
gives the reciprocal divided by the number
of species.
Usage
simpson(x)
dominance(x)
invsimpson(x)
simpson_e(x)
Arguments
x |
A numeric vector of species counts or proportions. |
Details
For a vector of species counts x
, the dominance index is defined as
where is the species proportion,
, and
is the total number of counts. This is
equal to the probability of selecting two individuals from the same species,
with replacement. Relation to other definitions:
Equivalent to
dominance()
inskbio.diversity.alpha
.Similar to the
simpson
calculator in Mothur. They use the unbiased estimate.
Simpson's index is defined here as , or the probability of
selecting two individuals from different species, with replacement. Relation
to other definitions:
Equivalent to
diversity()
invegan
withindex = "simpson"
.Equivalent to
simpson()
inskbio.diversity.alpha
.
The inverse Simpson index is . Relation to other definitions:
Equivalent to
diversity()
invegan
withindex = "invsimpson"
.Equivalent to
enspie()
inskbio.diversity.alpha
.Similar to the
invsimpson
calculator in Mothur. They use the unbiased estimate.
Simpson's evenness index is the inverse Simpson index divided by the
number of species observed, . Relation to other definitions:
Equivalent to
simpson_e()
inskbio.diversity.alpha
.
Please be warned that the naming conventions vary between sources. For
example Wikipedia calls the Simpson index and
the
Gini-Simpson index. We have followed the convention from
vegan
, to
avoid confusion within the R
ecosystem.
Value
The value of the dominance (), Simpson index, or
inverse Simpson index. The dominance is undefined if the vector sums to
zero, in which case we return
NaN
.
Examples
x <- c(15, 6, 4, 0, 3, 0)
dominance(x)
# Simpson is 1 - D
simpson(x)
1 - dominance(x)
# Inverse Simpson is 1/D
invsimpson(x)
1 / dominance(x)
# Simpson's evenness is 1 / (D * S)
simpson_e(x)
1 / (dominance(x) * richness(x))