PCMBase (version 1.2.10)

PCMTreeGetTipsInRegime: Get the tips belonging to a regime in a tree

Description

Get the tips belonging to a regime in a tree

Usage

PCMTreeGetTipsInRegime(tree, regime)

Arguments

tree

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

regime

a character or integer denoting a regime in the tree.

Value

an integer vector with the ids of the tips belonging to regime.

See Also

PCMTreeGetTipsInPart, PCMTreeGetPartNames, PCMRegimes, PCMTreeGetPartRegimes, PCMTreeSetPartRegimes, PCMTreeGetPartition

Examples

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
PCMTreePlot(tree) + ggtree::geom_nodelab() + ggtree::geom_tiplab()
# }
# NOT RUN {
regime <- PCMRegimes(tree)[1]
PCMTreeGetTipsInRegime(tree, regime)
print(regime)

# }

Run the code above in your browser using DataCamp Workspace