PCMTreeGetTipsInPart: Get the tips belonging to a part in a tree

View source: R/PCMTree.R

PCMTreeGetTipsInPartR Documentation

Get the tips belonging to a part in a tree

Description

Get the tips belonging to a part in a tree

Usage

PCMTreeGetTipsInPart(tree, part)

Arguments

tree

a phylo object with an edge.regime member or a PCMTree object

part

a character or integer denoting a part name in the tree.

Value

an integer vector with the ids of the tips belonging to part

See Also

PCMTreeGetTipsInRegime, PCMTreeGetPartNames, PCMRegimes, PCMTreeGetPartRegimes, PCMTreeSetPartRegimes

Examples

set.seed(1, kind = "Mersenne-Twister", normal.kind = "Inversion")
tree <- ape::rtree(10)
regimes <- sample(letters[1:3], nrow(tree$edge), replace = TRUE)
PCMTreeSetRegimesForEdges(tree, regimes)

PCMTreePlot(tree) + ggtree::geom_nodelab() + ggtree::geom_tiplab()

part <- PCMTreeGetPartNames(tree)[1]
PCMTreeGetTipsInPart(tree, part)
print(part)


PCMBase documentation built on Nov. 18, 2022, 9:06 a.m.