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

View source: R/PCMTree.R

PCMTreeSetRegimesForEdgesR Documentation

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.

Note

Calling this function overwrites the current partitioning of the tree.

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)

if(requireNamespace("ggtree"))
PCMTreePlot(tree)



venelin/PCMBase documentation built on March 14, 2024, 8:24 p.m.