Learn R Programming

BAMMtools (version 2.1.12)

getMeanBranchLengthTree: Compute phylogeny with branch lengths equal to corresponding macroevolutionary rate estimates

Description

Takes a bammdata object and computes a phylogenetic tree where branch lengths are equal to the mean of the marginal distributions of rates on each branch. This tree can be plotted to visualize rate variation across a phylogeny.

Usage

getMeanBranchLengthTree(ephy, rate = "speciation")

Value

A list with the following components:

  • phy: A phylogenetic tree, topologically identical to the model tree, but with branch lengths replaced by the mean (marginal) rates on each branch as estimated from the posterior samples in the bammdata object.

  • mean: The mean rate over all branches.

  • median: the median rate over all branches.

Arguments

ephy

An object of class bammdata.

rate

The type of rate-tree to be computed. Options: "speciation" (default), "extinction", "ndr" (net diversification), and "trait".

Author

Dan Rabosky

References

http://bamm-project.org/

See Also

plot.bammdata

Examples

Run this code
data(whales)
data(events.whales)
ed <- getEventData(whales, events.whales, burnin=0.1, nsamples=500)
ed2 <- subsetEventData(ed, index = 1:20)
ratetree <- getMeanBranchLengthTree(ed2, rate='speciation')
plot(ratetree$phy, show.tip.label=FALSE)

Run the code above in your browser using DataLab