Measurement and partitioning of diversity, based on Tsallis entropy, following Marcon and Herault (2015)
entropart is an R package that provides functions to calculate alpha, beta and gamma diversity of communities, including phylogenetic and functional diversity.
Estimation-bias corrections are available.
In the entropart package, individuals of different species are counted in several communities which may (or not) be agregated to define a metacommunity. In the metacommunity, the probability to find a species in the weighted average of probabilities in communities. This is a naming convention, which may correspond to plots in a forest inventory or any data organized the same way.
Basic functions allow computing diversity of a community. Data is simply a vector of probabilities (summing up to 1) or of abundances (integer values that are numbers of individuals). Calculate entropy with functions such as Tsallis, Shannon, Simpson, Hurlbert or GenSimpson and explicit diversity (i.e. effective number of species) with Diversity and others. By default, the best available estimator of diversity will be used, according to the data.
Communities can be simulated by rCommunity, explicitely declared as a species distribution (as.AbdVector or as.ProbaVector), and plotted.
Phylogenetic entropy and diversity can be calculated if a phylogenetic (or functional), ultrametric tree is provided. See PhyloEntropy, Rao for examples of entropy and PhyloDiversity to calculate phylodiversity, with the state-of-the-art estimation-bias correction. Similarity-based diversity is calculated with Dqz, based on a similarity matrix.
A quick introduction is in
A full documentation is available online, in the "Articles" section of the web site of the vignette. It is a continuous update of the paper published in the Journal of Statistical Software (Marcon & Hérault, 2015).
The development version documentation is also available.
Marcon, E. and Herault, B. (2015). entropart: An R Package to Measure and Partition Diversity. Journal of Statistical Software. 67(8): 1-26.
autoplot()methods added for entropart objects.
Richnessreturned 0 instead of 1 for a community with a single species.
HqzBeta()returned erroneous values if a species probability was equal to zero.
PPtreewhatever the function.
CheckArguments = TRUE) is not possible when the package is not loaded and a function is called by
entropart::function(). An error was returned. It is replaced by a warning.
Originality.Species()is deprecated because it is pointless.
ade4::originality()allows calculating it for q=2. Leinster (2009) and Leinster and Meckes (2015) showed that
Originality.Species()does not depend on the order of diversity.
Entropy.zrather than the R code of
bcTsallis(). This is much faster when the number of individual is high. Applies to
ChaoWangJost(Best) estimator too.
DivProfile()now allows computing bootstrap confidence intervals.
ChaoWangJostcorrection. Reported by Zach Marion. Only partly corrected in Version 1.4-1. Corrected.
DivEstreturned incorrect beta diversity if q was not 1. Corrected.
Unveiledestimator is more versatile.
Correction = "Unveil"is deprecated and replaced by
UnveilJin functions such as
PhyloApply()using the parallel package mclapply. No effect on Windows, pretty much faster on other systems.
sapply()makes some functions faster.
NAif the tree contained more species than the probability vector. Now, the tree may be pruned or kept unchanged and extra species considered to have probabilities 0.
ChaoPD()returned erroneous unnormalized diversity (divided by two) because of the conVersion of
htreedivides branch lengths by two. Corrected.
NAif the distibution contained singletons but no doubletons. Corrected.
phylogobjects (deprecated in ade4) are replaced by
phylotrees from package ape in the definition of the
PPtreeclass. Issues caused by
phylogsuch as replacing
_in species names do not occur any longer.
phylogtrees are still accepted for compatibility.
Richnessnow returns a named value. The name contains the estimator used.
bcDiversity(). New "best" estimator.
bcTsallisand similar functions with a probability vector instead of abundance values could cause errors depending in the correction. Correction is now forced to
Nonewith a warning.
.Machine$double.eps. Now set to S times (where S is the number of species, i.e the vector's length).
Hqz()returned an error if all probability values were 0 except one.
summmary.DivPart(). Lines were too long.
plot.DivPart("alpha and gamma" instead of "alpha/gamma").
PhyloValueobjects (summary added).
ChaoPD()returned an incorrect value when q=0 and some probabilities =0.
Divest()always calculated neutral diversity of simulated communities so the confidence interval was erroneous for phylodiversity. Corrected.
Paracou618.distdistance matrix between species of
EntropyCIfunction added: Entropy of Monte-Carlo simulated communities.
SimTestclass added to test a value against a simulated distribution (see
Importsdirective rather than
mergeandlabeldoes not return warnings any longer (column names are better addressed).
Hqz()was erroneous for q<>1. Corrected.
bcPhyloDiversity()returned an incorrect
summary.MCentropy()did not return the name of the tree. Corrected.
plot.DivProfile(..., Which="Communities"). Corrected.