calc_alpha_div: Calculate common alpha-diversity metrics You need the "vegan"...

View source: R/multivar.R

calc_alpha_divR Documentation

Calculate common alpha-diversity metrics You need the "vegan" package installed to your R project and loaded for this code to run

Description

Faith's Phylogenetic Diversity ("PD") can be calculated only if a tree is provided. The tree can have extra tips, but there must be tip labels for all taxa in the provided table.

Usage

calc_alpha_div(df, tree = NULL, index = c("nobs", "shannon", "PD"))

Arguments

df

sample x taxon abundance table (usual format for vegan)

tree

tree with tips matching taxa in the abundance table (only needed for PD)

index

which of the indices to calculate? (nobs = no. of observations, shannon = Shannon Index, PD = Faith's PD)

Value

a data.frame of alpha diversity values (and sample names)


leylabmpi/LeyLabRMisc documentation built on Nov. 3, 2022, 3:45 p.m.