hill_phylo: Phylogenetic diversity through Hill Numbers

View source: R/hill_phylo.R

hill_phyloR Documentation

Phylogenetic diversity through Hill Numbers

Description

Calculate alpha phylogenetic diversity based on Hill numbers

Usage

hill_phylo(
  comm,
  tree,
  q = 0,
  base = exp(1),
  rel_then_pool = TRUE,
  show_warning = TRUE,
  return_dt = FALSE
)

Arguments

comm

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

tree

A phylogeny with class 'phylo'.

q

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

base

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

rel_then_pool

default is TRUE. Abundance of species are first changed to relative abundance within sites, then pooled into one assemblage. If FALSE, sites are pooled first, then change abundance of species to relative abundance.

show_warning

whether to print warning, default is TRUE.

return_dt

Whether to return the Phylogenetic Hill numbers Dt, default is 'FALSE'.

Value

A vector of hill number based phylogenetic diversity ('PD(T)', effective total branch length) for all sites.

Author(s)

Chiu & Chao & Daijiang Li

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

Examples

comm = dummy = FD::dummy$abun
tree = ape::rtree(n = ncol(comm), tip.label = paste0('sp', 1:8))
hill_phylo(comm, tree, q = 0)
hill_phylo(comm, tree, q = 0.999)
hill_phylo(comm, tree, q = 1)
hill_phylo(comm, tree, q = 2)


hillR documentation built on Aug. 20, 2023, 1:08 a.m.