Learn R Programming

BAMMtools (version 2.1.12)

getShiftNodesFromIndex: Identify nodes associated with rate shifts from bammdata object

Description

Find the node numbers associated with rate shifts for a specified sample from the posterior distribution contained in a bammdata object.

Usage

getShiftNodesFromIndex(ephy, index)

Value

A vector of nodes (excluding the root) that define branches on which shifts occurred for the specified sample from the posterior. Will return a numeric of length 0 if no non-root shifts occur in the specified sample.

Arguments

ephy

A bammdata object.

index

The index value of the posterior sample from which you want to identify shift nodes. This is not the same as the actual generation number of the MCMC sample. If your bammdata object contains 100 samples from the posterior distribution, the value of index must range from 1 to 100.

Author

Dan Rabosky

See Also

addBAMMshifts, plot.bammdata, maximumShiftCredibility

Examples

Run this code
data(whales, events.whales)
ed <- getEventData(whales, events.whales, burnin=0.1, nsamples=500)

# Get the maximum shift credibility configuration:
msc <- maximumShiftCredibility(ed)

# Get the nodes at which shifts occurred in the 
# maximum shift credibility configuration:

getShiftNodesFromIndex(ed, index=msc$sampleindex)

Run the code above in your browser using DataLab