Learn R Programming

hillR (version 0.5.2)

hill_phylo_parti_pairwise: Pairwise phylogenetic diversity through Hill numbers

Description

Calculate pairwise phylogenetic diversity.

Usage

hill_phylo_parti_pairwise(
  comm,
  tree,
  q = 0,
  output = c("data.frame", "matrix"),
  pairs = c("unique", "full"),
  rel_then_pool = TRUE,
  .progress = TRUE,
  show_warning = TRUE,
  ...
)

Value

A data frame or a matrix with results for all pairwise comparisons.

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.

output

output type: data.frame (default) or matrix. If matrix, then this function will return a list of matrices.

pairs

full or unique (default). Do you want to compare all possible pairs (i.e. n^2) or just unique pairs (i.e. choose(n, 2))?

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.

.progress

Whether to show progress bar. Default is `TRUE`.

show_warning

whether to print warning, default is TRUE.

...

additional arguments for hill_func_parti.

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

See Also

hill_phylo_parti

Examples

Run this code
if (FALSE) {
comm = dummy = FD::dummy$abun
tree = ape::rtree(n = ncol(comm), tip.label = paste0('sp', 1:8))
hill_phylo_parti_pairwise(comm, tree, q = 0, show_warning = FALSE)
hill_phylo_parti_pairwise(comm, tree, q = 0.999, show_warning = FALSE)
hill_phylo_parti_pairwise(comm, tree, q = 1, show_warning = FALSE)
hill_phylo_parti_pairwise(comm, tree, q = 2, show_warning = FALSE)
}

Run the code above in your browser using DataLab