PDindex: Calculate Phylogenetic Diversity (PD) or Phylogenetic...

PDindexR Documentation

Calculate Phylogenetic Diversity (PD) or Phylogenetic Endemism (PE) for a given distribution.

Description

This function calculates the Phylogenetic Diversity (PD) or Phylogenetic Endemism (PE) for a given distribution of species across a phylogeny.

Usage

PDindex(
  tree = tree,
  distribution = distribution,
  root = FALSE,
  index = "PD",
  percentual = FALSE
)

Arguments

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.

Value

A numeric vector containing the calculated PD or PE values for each area in the distribution matrix.

Examples


# Calculate PD for each set
PD_values <- PDindex(tree = tree, distribution = distribution) 


Dmirandae/blepd documentation built on Jan. 17, 2025, 3:08 p.m.