Entropy Partitioning to Measure Diversity

Measurement and partitioning of diversity, based on Tsallis entropy, following Marcon and Herault (2015) . entropart provides functions to calculate alpha, beta and gamma diversity of communities, including phylogenetic and functional diversity. Estimation-bias corrections are available.

CRAN version Research software impact Build Status codecov

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 full documentation is available in the main vignette. In R, type: vignette("entropart"). It is a continuous update of the paper published in the Journal of Statistical Software (Marcon & Hérault, 2015).

A quick introduction is in vignette("docs", "entropart").


Marcon, E. and Herault, B. (2015). entropart: An R Package to Measure and Partition Diversity. Journal of Statistical Software. 67(8): 1-26.


CHANGES IN entropart VERSION 1.5-3


o On Travis now. o Reduced package size. o The rule to calculate the number of individuals of MetaCommunities has been changed to improve gamma diversity bias correction. See the user manual vignette. o Generic function arguments cleaned up.


o Very large metacommunities returned an integer overflow error.

CHANGES IN entropart VERSION 1.4-8


o HqzBeta() returned erroneous values if a species probability was equal to zero.


o On GitHub now. o Documentation updated: phylogenetic dendrograms can be of class phylo, phylog, hclust of PPtree whatever the function. o The introduction vignette is HTML now. o A new vignette is dedicated to phylogenies.

CHANGES IN entropart VERSION 1.4-7


o Argument checking (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.


o Explicit export of all non-internal functions instead of exportPattern("^[[:alpha:]]+") o Updated references to published articles. o Updated help("entropart"). o New introduction vignette. o Vignettes compiled with knitr instead of Sweave.

CHANGES IN entropart VERSION 1.4-6


o LazyData is used to save memory. o Better reporting of the argument names in embedded calls of functions.


o The simulation of log-series communities was incorrect.

CHANGES IN entropart VERSION 1.4-5


o Generalized Simpson's entropy and diversity added (GenSimpson and GenSimpsonD). o 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.


o ZhangGrabchak estimator of entropy is now calculated by the C code of EntropyEstimation::Tsallis.z/Entropy.z rather than the R code of bcTsallis(). This is much faster when the number of individual is high. Applies to ChaoWangJost (Best) estimator too.

CHANGES IN entropart VERSION 1.4-4


o DivProfile() now allows computing bootstrap confidence intervals.


o The entropy estimation (of order different from 1) of a distribution with no singleton returned NA with ChaoWangJost correction. Reported by Zach Marion. Only partly corrected in version 1.4-1. Corrected. o DivEst returned incorrect beta diversity if q was not 1. Corrected.

CHANGES IN entropart VERSION 1.4-3


o All scalar values of diversity or entropy are now named. Their name is the bias correction used to obtain them. o The Unveiled estimator is more versatile. Correction = "Unveil" is deprecated and replaced by "UnveilC", "UnveiliC" or "UnveilJ" in functions such as Tsallis() or Diversity().


o Parallelization of DivProfile(), CommunityProfile() and PhyloApply() using the parallel package (mclapply). No effect on Windows, pretty much faster on other systems. o Extensive use of vapply() instead of sapply() makes some functions faster. o AllenH() and ChaoPD() returned NA if 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.


o Using phylog trees in AllenH and ChaoPD() returned erroneous unnormalized diversity (divided by two) because of the conversion of phylog to htree divides branch lengths by two. Corrected. o The richness estimator iChao1 returned NA if the distibution contained singletons but no doubletons. Corrected.

CHANGES IN entropart VERSION 1.4.1


o phylog objects (deprecated in ade4) are replaced by phylo trees from package ape in the definition of the PPtree class. Issues caused by phylog such as replacing . and - by _ in species names do not occur any longer. phylog trees are still accepted for compatibility. o ChaoPD() and AllenH() now accept phylo trees. o Richness now returns a named value. The name contains the estimator used. o Updated CITATION: the paper about this package has been published: Eric Marcon, Bruno Herault (2015). entropart: An R Package to Measure and Partition Diversity. Journal of Statistical Software, 67(8), 1-26.


o The entropy estimation of a distribution with no singleton returned NA with ChaoWangJost correction. Corrected. o Entropy or diversity of a vector of zeros returned 0. It now returns NA.

CHANGES IN entropart VERSION 1.3.3


o Abundance and probability vector objects. See ?SpeciesDistribution o Hurlbert diversity. See ?Hurlbert o Optimal.Similarity. o Miller-Madow estimator of entropy (Miller, 1955) added in bcShannon(). o Chao and Jost (2015) estimator of diversity added in bcTsallis() and bcDiversity(). New "best" estimator. o Chao et al. (2015) probability estimation of observed species. See ?TunedPs o Estimators of the number of species. See ?Richness o Abundance Frequency Count of species. See ?AbdFreqCount o Community profiles can be calculated with confidence intervals. See ?CommunityProfile o Random Communities. See ?rCommunity


o Applying bcTsallis and similar functions with a probability vector instead of abundance values could cause errors depending in the correction. Correction is now forced to "None" with a warning. o Allowed rounding error was too small on some systems (typically r-patched-solaris-sparc) to recognize probability vectors. The difference between their sum and 1 had to be less than 3 times .Machine$double.eps. Now set to S times (where S is the number of species, i.e the vector's length).

CHANGES IN entropart VERSION 1.2.1


o Zhang and Grabchak (2014) bias correction for Shannon beta entropy added. o Unbiased estimator of Rao's entropy added (bcRao).


o DqZ() and Hqz() returned an error if all probability values were 0 except one.


o Improved readability of error messages for bad arguments. o Improved formating of summmary.DivPart(). Lines were too long. o Improved legend for the x-axis of plot.DivPart ("alpha and gamma" instead of "alpha/gamma"). o Improved support of PhyloValue objects (summary added). o Improved help for MetaCommunity.

CHANGES IN entropart VERSION 1.2.0


o ChaoPD() returned an incorrect value when q=0 and some probabilities =0.

CHANGES IN entropart VERSION 1.2.0


o Full support of similarity-based diversity added


o Default values for arguments added whenever possible.

CHANGES IN entropart VERSION 1.1.4


o Zhang(2012) bias correction for Shannon entropy added. o Zhang and Grabchak (2014) bias correction for Tsallis entropy added.


o Divest() always calculated neutral diversity of simulated communities so the confidence interval was erroneous for phylodiversity. Corrected.

CHANGES IN entropart VERSION 1.1.3


o Paracou618.dist distance matrix between species of Paracou618.MC added.


o Imports directive rather than Depends for ade4. o mergeandlabels does not return warnings any longer (column names are better addressed).


o Legend was not displayed in plot.DivProfile(..., Which="Communities"). Corrected.

CHANGES IN entropart VERSION 1.1.2


o Chao, Wang and Jost (2013) bias correction for Shannon entropy added. o EntropyCI function added: Entropy of Monte-Carlo simulated communities. o Tools to manipulate MetaCommunity objects added (see ?MergeMC) o SimTest class added to test a value against a simulated distribution (see ?SimTest). o Vignette added.


o Hqz() was erroneous for q!=1. Corrected. o bcPhyloEntropy() and bcPhyloDiversity() returned an incorrect $Distribution component. Corrected. o summary.MCentropy() did not return the name of the tree. Corrected.

CHANGES IN entropart VERSION 1.1.1


o First version.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.5-3 by Eric Marcon, a year ago


Report a bug at https://github.com/EricMarcon/entropart/issues

Browse source code at https://github.com/cran/entropart

Authors: Eric Marcon [aut, cre] , Bruno Herault [aut]

Documentation:   PDF Manual  

Task views: Phylogenetics, Especially Comparative Methods

GNU General Public License license

Imports ade4, ape, EntropyEstimation, geiger, graphics, grDevices, parallel, stats, utils, vegan

Suggests testthat, knitr, rmarkdown, packagedocs

Imported by HierDpart, inpdfr.

Suggested by diverse.

See at CRAN