Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hill_taxa

Taxonomic diversity through Hill Numbers


Description

Calculate taxonomic diversity for each site (alpha diversity).

Usage

hill_taxa(comm, q = 0, MARGIN = 1, base = exp(1))

Arguments

comm

A data frame of vegetation data. Sites as rows, species as columns.

q

Hill number, q = 0 (default) to get species richness, q = 1 to get shannon entropy, q = 2 will give inverse Simpson.

MARGIN

default is 1, if sites are columns, set MARGIN to 2.

base

default is exp(1), the base of log.

Value

A named vector, diversity values for each site in the comm.

References

Chao, Anne, Chun-Huo Chiu, and Lou Jost. Unifying Species Diversity, Phylogenetic Diversity, Functional Diversity, and Related Similarity and Differentiation Measures Through Hill Numbers. Annual Review of Ecology, Evolution, and Systematics 45, no. 1 (2014): 297–324. <doi:10.1146/annurev-ecolsys-120213-091540>.

Jost, Lou. Entropy and diversity. Oikos 113, no. 2 (2006): 363-375. <doi:10.1111/j.2006.0030-1299.14714.x>.

Examples

dummy = FD::dummy
hill_taxa(comm = dummy$abun, q = 0)
# same as: vegan::specnumber(dummy$abun)
hill_taxa(comm = dummy$abun, q = 1)
# same as: exp(vegan::diversity(x = dummy$abun, index = 'shannon'))
hill_taxa(comm = dummy$abun, q = 2)
# same as: vegan::diversity(x = dummy$abun, index = 'invsimpson')
hill_taxa(comm = dummy$abun, q = 0.999)

hillR

Diversity Through Hill Numbers

v0.5.1
MIT + file LICENSE
Authors
Daijiang Li
Initial release
2021-03-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.