MRD: Calculate mean root distance

Description Usage Arguments Details Value References Examples

View source: R/MRD.R

Description

Given a picante-style community data matrix (sites are rows, species are columns), and a phylogeny, calculate the mean root distance of the set of taxa in each site.

Usage

1
MRD(samp, tree, abundance.weighted)

Arguments

samp

A picante-style community data matrix with sites as rows, and species as columns.

tree

An ape-style phylogeny.

abundance.weighted

Whether to weight the calculation by the abundance of a given species in a given plot.

Details

Mean root distance (MRD) as originally formulated by Kerr & Currie (1999) defined MRD as the mean number of nodes between a set of taxa and the root. It is not clear to me whether the number of nodes includes the tip itself. In other words, should a species connected directly to the root of the tree be considered to be separated by zero or one nodes from the root? I have chosen to define it as one, but am open to changing it. This definition emphasizes that "one" speciation event has occurred along that branch since the origin of the clade (all caveats about extinction and phylogenetic sampling aside). The abundance-weighted form of this calculation takes a row-wise (plot-wise) weighted-mean where the values are a species' node-distance to the root, and the weights are a species' abundance in the input community data matrix. I ran a quick test to see whether abundance-weighted MRD might be equal to IAC of Cadotte et al. (2010), and it does not seem to be. Therefore its utility is unknown (as is that of non-abundance weighted MRD).

Value

A vector of MRD values.

References

Kerr, J. T. and D. J. Currie. 1999. The relative importance of evolutionary and environmental controls on broad-scale patterns of species richness in North America. Ecoscience 6:329-337.

Examples

1
2
3
4
5
6
7
8
#simulate tree with birth-death process
tree <- geiger::sim.bdtree(b=0.1, d=0, stop="taxa", n=50)

sim.abundances <- round(rlnorm(5000, meanlog=2, sdlog=1)) + 1

cdm <- simulateComm(tree, richness.vector=10:25, abundances=sim.abundances)

results <- MRD(cdm, tree, abundance.weighted=FALSE)

eliotmiller/metricTester documentation built on Dec. 16, 2019, 12:39 p.m.