subtreeBAMM: Pulls out a subtree from 'bammdata' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/subtreeBAMM.R

Description

Given a set of tips or a node, this function extracts the corresponding subtree from the bammdata object. User should specify either a set of tips or a node, and the node will overwrite the tips if both are given.

Usage

1
subtreeBAMM(ephy, tips = NULL, node = NULL)

Arguments

ephy

An object of class bammdata.

tips

An integer or character vector indicating which tips (more than one) to be included in the subtree.

node

An integer indicating the root of the subtree to be extracted, and it must correspond to an innernode on the tree.

Details

This function allows users to extract a subtree from a big bammdata object, and examine the subset using plot.bammdata

Value

An object of class bammdata.

Author(s)

Huateng Huang

See Also

getmrca, plot.bammdata

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(whales, events.whales)
ephy <- getEventData(whales, events.whales, burnin=0.25, nsamples=500)

# specify a set of tips for the subtree
tips <- sample(ephy$tip.label,size=20,replace=FALSE)
subphy <- subtreeBAMM(ephy,tips=tips)

# specify a innernode for subsetting
subphy <- subtreeBAMM(ephy,node=103)

# plot the subtree
plot(subphy)

BAMMtools documentation built on May 29, 2017, 5:47 p.m.