Function for estimating one of three metrics of phylogenetic diversity. It is a wrapper for various functions from picante package.

diversity_estimate_phylogenetic(
  data_matrix,
  phylogenetic_tree,
  sel_method = c("diversity", "nri", "nti"),
  abundance_weighted = TRUE,
  rand = 999,
  iterations = 1000
)

Arguments

data_matrix

Data matrix. Rows as levels and columns as data. Row names should be the sample_id.

phylogenetic_tree

Phylogenetic backbone phylogenetic_tree constructed using ape package

sel_method

Selected method for diversity estimation.

  • "diversity" - Faith's phylogenetic diversity

  • "nri" = Net Relatedness Index

  • "nti" = Nearest Taxon Index

abundance_weighted

Logical. If FALSE, presence-absence data will be used.

rand

Numeric. Number of randomization

iterations

Number of iterations to use for each randomization (for independent swap and trial null models)

Value

Data frame with diversity metric estimated for each level (sample). Possible outputs depending on the sel_method:

  • n_taxa - Taxonomic richness

  • pd_faith - Faith's phylogenetic diversity

  • pd_mpd - Mean Pairwise Distance

  • pd_nri - Net Relatedness Index

  • pd_mntd - Mean Nearest Taxon Distance

  • pd_nti - Nearest Taxon Index

  • z_score - Standarise Effect Size (SES), calculated as (observed value - mean randomised value ) / sd of randomised value

Author

Ondrej Mottl, Kuber Bhatta