getShiftNodesFromIndex {BAMMtools}R Documentation

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)

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.

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.

Author(s)

Dan Rabosky

See Also

addBAMMshifts, plot.bammdata, maximumShiftCredibility

Examples

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)

[Package BAMMtools version 2.1.11 Index]