hilldiv (version 1.5.1)

alpha_div: Alpha diversity

Description

Compute alpha diversity of a system comprised of multiple samples from a count (OTU/ASV) table. If a tree object is provided, the computed alpha diversity accounts for the phylogenetic relations across OTUs/ASVs.

Usage

alpha_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.

Value

An alpha diversity value.

Details

Alpha diversity computation (based on Hill numbers)

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, gamma_div, match_data

Examples

Run this code
# NOT RUN {
data(bat.diet.otutable)
data(bat.diet.tree)
alpha_div(countable=bat.diet.otutable,qvalue=1)
alpha_div(countable=bat.diet.otutable,qvalue=1,tree=bat.diet.tree)
weight.vector = rep(1/ncol(bat.diet.otutable),ncol(bat.diet.otutable))
alpha_div(bat.diet.otutable,1,bat.diet.tree,weight.vector)
# }

Run the code above in your browser using DataLab