faith_pd: Faith's phylogenetic diversity

Description Usage Arguments Details Value References Examples

Description

Faith's phylogenetic diversity gives the total branch length on a phylogenetic tree that is spanned by a community. The abundance of each species in the community is not considered.

Usage

1
faith_pd(x, tree, x_labels = NULL)

Arguments

x

A numeric vector of species counts or proportions, or a logical vector of species presence/absence.

tree

A phylogenetic tree object..

x_labels

A character vector of species labels for x.

Details

If the vector x is named, the names will be automatically used to match x with the tree. Missing names are filled in with zero counts. If x is not named and x_labels is provided, these labels are used to match the elements of x with the tree. If x is not named and x_labels is not provided, it is assumed that x is already in the correct order, and we simply check that its length matches the number of tips in the tree.

Value

Faith's phylogenetic diversity, PD ≥q 0.

References

Faith DP. Conservation evaluation and phylogenetic diversity. Biol. Conserv. 1992;61:1–10. doi: 10.1016/0006-3207(92)91201-3.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Faith's phylogenetic diversity for whole tree is equal to the sum of the
# branch lengths.
sum(faith_tree$edge.length)
faith_pd(c(1, 1, 1, 1, 1), faith_tree)

# Can use named vector or additional argument to match species to tree.
faith_tree$tip.label
faith_pd(c(0, 0, 0, 10, 12), faith_tree)
faith_pd(c(d=10, e=12), faith_tree)
faith_pd(c(10, 12), faith_tree, c("d", "e"))

Example output

[1] 45
[1] 45
[1] "a" "b" "c" "d" "e"
[1] 29
[1] 29
[1] 29

abdiv documentation built on Jan. 20, 2020, 5:07 p.m.