diversity
, fisher.alpha
, specpool
and specnumber
(all from vegan), although these same functions are called. Some other statistics are also calculated such as the reciprocal Berger-Parker diversity index and abundance (not a diversity statistic). The statistics can be calculated for the entire community, for each site separately, the mean of the sites can be calculated or a jackknife estimate can be calculated for the community.
diversityresult(x, y="", factor, level, index="Shannon", method="all", sortit=F, digits=8)
diversityvariables(x, y, digits=8)
diversitycomp(x,y="",factor1,factor2="",index="Shannon", method="all",sortit=F,...)
diversitycomp
. diversityresult
. diversitycomp
, the number of sites is provided as "n".
diversity
, fisher.alpha
, specpool
, estimateR
and specnumber
(all from vegan) are called to calculate the various statistics.Function diversityvariables
adds variables to the environmental dataset (richness, Shannon, Simpson, inverseSimpson, Logalpha, Berger, Jevenness, Eevenness).
The reciprocal Berger-Parker diversity index is the reciprocal of the proportional abundance of the most dominant species.
J-evenness is calculated as: H / ln(S) where H is the Shannon diversity index and S the species richness.
E-evenness is calculated as: exp(H) / S where H is the Shannon diversity index and S the species richness.
The method of calculating the diversity statistics include following options: "all" calculates the diversity of the entire community (all sites pooled together), "s" calculates the diversity of each site separatedly, "mean" calculates the average diversity of the sites, whereas "Jackknife" calculates the jackknifed diversity for the entire data frame. Methods "s" and "mean" are not available for function diversitycomp. Gamma diversity estimators assume that the method is "all".
Functions diversityresult
and diversitycomp
allow to calculate diversity statistics for subsets of the community and environmental data sets. Function diversityresult
calculates the diversity statistics for the specified level of a selected environmental variable. Function diversitycomp
calculates the diversity statistics for all levels of a selected environmental variable separatedly. When a second environmental variable is provided, function diversitycomp
calculates diversity statistics as a crosstabulation of both variables.
library(vegan)
data(dune.env)
data(dune)
Diversity.1 <- diversityresult(dune, y=dune.env, factor='Management',
level='NM', index='Shannon' ,method='s', sortit=TRUE, digits=3)
Diversity.1
diversitycomp(dune, y=dune.env, factor1='Management', factor2="Moisture",
index='Shannon' ,method='all', sortit=TRUE, digits=3)
Run the code above in your browser using DataLab