gamma_div {hilldiv} | R Documentation |
Gamma diversity
Description
Compute gamma diversity of a system from a matrix (OTU table) containing multiple samples. If a tree is provided, the computed gamma diversity accounts for the phylogenetic relations across OTUs.
Usage
gamma_div(countable,qvalue,tree,weight)
Arguments
countable |
A count table (matrix/data.frame) indicating the absolute or relative OTU/ASV abundances of multiple samples. Columns must refer to samples and rows to OTUs/ASVs. |
qvalue |
A positive number, usually between 0 and 5, but most commonly 0, 1 or 2. It can be an integer or contain decimals. |
tree |
A phylogenetic tree of class 'phylo'. The tip labels must match the row names in the count table. Use the function match_data() if the count table and tree names do not match. |
weight |
A vector indicating the relative weight of each sample. The order needs to be identical to the order of the samples in the OTU table. The values need to sum up to 1. If empty, all samples are weighed the same. |
Details
Gamma diversity computation (based on Hill numbers)
Value
A gamma diversity value.
Author(s)
Antton Alberdi, anttonalberdi@gmail.com
References
Alberdi, A., Gilbert, M.T.P. (2019). A guide to the application of Hill numbers to DNA-based diversity analyses. Molecular Ecology Resources, 19, 804-817.
Chao, A., Chiu, C.H., & Hsieh, T. C. (2012). Proposing a resolution to debates on diversity partitioning. Ecology, 93, 2037-2051.
Jost, L. (2007). Partitioning diversity into independent alpha and beta components. Ecology, 88, 2427-2439.
See Also
div_part
, alpha_div
, match_data
Examples
data(bat.diet.otutable)
data(bat.diet.tree)
data(bat.diet.hierarchy)
gamma_div(countable=bat.diet.otutable,qvalue=1)
gamma_div(countable=bat.diet.otutable,qvalue=1,tree=bat.diet.tree)
weight.vector = rep(1/ncol(bat.diet.otutable),ncol(bat.diet.otutable))
gamma_div(bat.diet.otutable,1,bat.diet.tree,weight.vector)