diversity(x, index = "shannon", MARGIN = 1, base = exp(1))
rarefy(x, sample, MARGIN = 1)
fisher.alpha(x, MARGIN = 1, se = FALSE, ...)
shannon
, simpson
or
invsimpson
.base
used in shannon
.nlm
se = TRUE
, function fisher.alpha
returns a data
frame with items for $\alpha$ (alpha
), its approximate
standard errors (se
), residual degrees of freedom
(df.residual
), and the code
returned by
nlm
on the success of estimation. Both variants of Simpson's index are based on $S = \sum p_i^2$. Choice simpson
returns $1-S$ and
invsimpson
returns $1/S$.
Function rarefy
gives the expected species richness in random
subsamples of size sample
from the community. The maximum
permissible sample size is $N - \max(n_i)$, where $N$ is the
total number of individuals and $n_i$ are the abundances of
species. Please note that rarefaction can be done only
with genuine
counts of individuals: the current function will silently truncate
abundances to integers and give wrong results. The function
rarefy
is based on Hurlbert's (1971) formulation.
Function fisher.alpha
estimates the $\alpha$ parameter of
Fisher's logarithmic series where the expected
number of species $f$ with $n$ observed individuals is
$f_n = \alpha x^n / n$ (Fisher et al. 1943). The estimation
follows Kempton & Taylor (1974) and uses function
nlm
. The estimation is possible only for genuine
counts of individuals. The function can optionally return standard
errors of $\alpha$. These should be regarded only as rough
indicators of the accuracy: the confidence limits of $\alpha$ are
strongly
non-symmetric and standard errors cannot be used in Normal inference.
Better stories can be told about Simpson's index than about
Shannon's index, and still more grandiose stories about
rarefaction (Hurlbert 1971). However, these indices are all very
closely related (Hill 1973), and there is no reason to despise one more than
others (but if you are a graduate student, don't drag me in, but obey
your Professor's orders). In particular, exponent of the Shannon
index is linearly related to inverse Simpson (Hill 1973) although the
former may be more sensitive to rare species. Moreover, inverse
Simpson is asymptotically equal to rarefied species richness in sample
of two indivividuals, and Fisher's $\alpha$ is very similar to
inverse Simpson.
Kempton, R.A. & Taylor, L.R. (1974). Log-series and log-normal parameters as diversity discriminators for Lepidoptera. Journal of Animal Ecology 43: 381-399.
data(varespec)
H <- diversity(varespec)
## Species richness (S) and Pielou's evenness (J):
S <- colSums(varespec>0)
J <- H/log(S)
## Other indices cannot be demonstrated because there are not yet
## count data sets in vegan.
Run the code above in your browser using DataLab