div_pd: Faith's Phylogenetic Diversity of a Community

View source: R/div_pd.R

div_pdR Documentation

Faith's Phylogenetic Diversity of a Community

Description

Estimate PD \insertCiteFaith1992divent or FD \insertCitePetchey2002divent from abundance or probability data and a phylogenetic or functional dendrogram.

Usage

div_pd(x, tree, ...)

## S3 method for class 'numeric'
div_pd(x, tree, prune = FALSE, as_numeric = FALSE, ..., check_arguments = TRUE)

## S3 method for class 'species_distribution'
div_pd(
  x,
  tree,
  prune = FALSE,
  gamma = FALSE,
  as_numeric = FALSE,
  ...,
  check_arguments = TRUE
)

Arguments

x

An object, that may be a named numeric vector (names are species names) containing abundances or probabilities, or an object of class abundances or probabilities.

tree

an ultrametric, phylogenetic tree. May be an object of class phylo_divent, ape::phylo, ade4::phylog or stats::hclust.

...

Unused.

prune

What to do when some species are in the tree but not in x? If TRUE, the tree is pruned to keep species of x only. The height of the tree may be changed if a pruned branch is related to the root. If FALSE (default), the length of branches of missing species is not summed but the height of the tree is never changed.

as_numeric

if TRUE, a number or a numeric vector is returned rather than a tibble.

check_arguments

if TRUE, the function arguments are verified. Should be set to FALSE to save time when the arguments have been checked elsewhere.

gamma

if TRUE, \gamma diversity, i.e. diversity of the metacommunity, is computed.

Details

Estimators to deal with incomplete sampling are not implemented. Use function div_hill with argument q = 0 if they are needed.

PD and FD are defined as the total length of the branches of the tree.

All species of the species_distribution must be found in the tips of the tree.

Value

A tibble with the site names, the estimators used and the estimated diversity.

References

\insertAllCited

Examples

# diversity of each community
div_pd(paracou_6_abd, tree = paracou_6_taxo)

# gamma diversity
div_pd(paracou_6_abd, tree = paracou_6_taxo, gamma = TRUE)


divent documentation built on April 3, 2025, 7:40 p.m.