Partitioning Hierarchical Diversity and Differentiation Across Metrics and Scales, from Genes to Ecosystems

Miscellaneous R functions for calculating and decomposing hierarchical diversity metrics, including hierarchical allele richness (q=0), hierarchical exponential Shannon entropy (q=1), hierarchical heterozygosity (q=2) and genetic differentiation (Fst and Delta D). This package allows you to analyse spatial structured genetic data or species data under a unifying framework (Gaggiotti, O. E. et al, 2018, Evol Appl, 11:1176-1193; ), which partitions diversity and differentiation into any hierarchical levels. It helps you easily structure and format your data. It produces diversity profiles (q=0,1,2), hierarchical diversities and differentiation, as well as the the correlation between geographic distance and genetic differentiation.

HierDpart is made for calculating hierarchical diversity and differentiation based on a unifying framework (Oscar, et al, 2018), whcih can investigate biological variation across metrixs and scales, from genes to ecosystem.

HierDpart is free R package: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. HierDpart works for calculating and decomposting real diversity (effective numbers qD, q=1,2,3 etc) and new differentiation (detaD) for any number of hierarchical levels based on a recently hieacrchical framework( Oscar,E et al, 2018). but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with HierDpart. If not, see

To install the development version of HierDpart

You will need the package devtools to be able to install the devel version of HierDpart. Install devtools:


To install HierDpart:





Gaggiotti, O. E., Chao, A., Peres-Neto, P., Chiu, C. H., Edwards, C., Fortin, M. J., ... & Selkoe, K. A. (2018). Diversity from genes to ecosystems: A unifying framework to study variation across biological metrics and scales. Evolutionary Applications.

Chao, A. and Chiu, C.-H. (2017) iDIP (Information-based Diversity Partitioning) Online: Software for partitioning Shannon diversity and phylogenetic diversity under multi-level hierarchical structures. Program and User's Guide published at

Jombart, T. (2008). adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24(11), 1403-1405.

Keenan, K., McGinnity, P., Cross, T. F., Crozier, W. W., & Prodöhl, P. A. (2013). diveRsity: an R package for the estimation and exploration of population genetics parameters and their associated errors. Methods in Ecology and Evolution, 4(8), 782-788.

Marcon, E., & Hérault, B. (2015). entropart: An R package to measure and partition diversity. Journal of Statistical Software, 67(8).

Goudet, J. (2005). Hierfstat, a package for R to compute and test hierarchical F‐statistics. Molecular Ecology Notes, 5(1), 184-186.

Jombart, T. (2008). adegenet: a R package for the multivariate analysis of genetic markers. Bioinformatics, 24(11), 1403-1405.


Reference manual

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


0.3.5 by Xinghu Qin, 5 days ago

Report a bug at

Browse source code at

Authors: Xinghu Qin

Documentation:   PDF Manual  

GPL (>= 3) license

Imports GGally, adegenet, diveRsity, dplyr, entropart, ggplot2, hierfstat, reshape2, tibble, ade4, vegan, ape, pegas, permute

Suggests knitr, testthat, rmarkdown

System requirements: GNU make

See at CRAN