PCMTreeSetRegimesForEdges {PCMBase} | R 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)
[Package PCMBase version 1.2.14 Index]