PDindex | R Documentation |
This function calculates the Phylogenetic Diversity (PD) or Phylogenetic Endemism (PE) for a given distribution of species across a phylogeny.
PDindex(
tree = tree,
distribution = distribution,
root = FALSE,
index = "PD",
percentual = FALSE
)
tree |
A phylogenetic tree object in the 'phylo' format. |
distribution |
A matrix or data frame representing the presence/absence of species in different areas. Rows represent areas and columns represent species. |
root |
Logical. If TRUE, the root of the tree is included in the calculations. Defaults to FALSE. |
index |
Character string specifying the index to calculate. Valid options are "PD" for Phylogenetic Diversity and "PE" for Phylogenetic Endemism. Defaults to "PD". |
percentual |
Logical. If TRUE, the results are returned as percentages of the total PD or PE. Defaults to FALSE. |
A numeric vector containing the calculated PD or PE values for each area in the distribution matrix.
# Calculate PD for each set
PD_values <- PDindex(tree = tree, distribution = distribution)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.