PCMBase (version 1.2.10)

PCMTreeSetRegimesForEdges: Set the regime for each individual edge in a tree explicitly

Description

Set the regime for each individual edge in a tree explicitly

Usage

PCMTreeSetRegimesForEdges(tree, regimes, inplace = TRUE)

Arguments

tree

a PCMTree or a phylo object.

regimes

a vector of the length equal to `nrow(tree$edge)`.

inplace

a logical indicating if the change should be done within the tree in the calling environment or a copy of the tree with modified regime assignment should be returned.

Value

if inplace is TRUE, nothing, otherwise a modified copy of tree.

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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab