Learn R Programming

metricTester (version 1.2.2)

observedBetaMetrics: Wrapper for prepping and calculating observed beta metrics

Description

Given a cdm and phylogeny, this function preps the data and calculates beta metrics of thee user's choice

Usage

observedBetaMetrics(tree, picante.cdm, metrics)

Arguments

tree
Phylo object
picante.cdm
A picante-style community data matrix with sites as rows, and species as columns
metrics
Optional list of named metric functions to use. If invoked, this option will likely be used to run a subset of the defined metrics. Defaults to all metrics defined in defineBetaMetrics()

Value

A data frame with the species richness, total abundance from the CDM, and calculated phylogenetic community structure beta metrics for all input plots from the CDM.

Details

A simple wrapper function to quickly prep data and calculate observed metrics.

References

Miller, E. T., D. R. Farine, and C. H. Trisos. 2015. Phylogenetic community structure metrics and null models: a review with new methods and software. bioRxiv 025726.

Examples

Run this code
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

#prep the data for the simulation
prepped <- prepSimulations(tree, arena.length=300, mean.log.individuals=2, 
	length.parameter=5000, sd.parameter=50, max.distance=20, proportion.killed=0.2,
	competition.iterations=3)

positions <- randomArena(prepped)

tempCDM <- makeCDM(positions, 15, 30)

results <- observedBetaMetrics(tree=tree, picante.cdm=tempCDM$picante.cdm)

#example of how to pass specific metrics to be calculated. not run

#results <- observedBetaMetrics(tree=tree, picante.cdm=tempCDM$picante.cdm, 
#metrics=list("richness"=metricTester:::my_betaRichness,
#"Ist"=metricTester:::my_Ist))

Run the code above in your browser using DataLab