PCMTreeSplitAtNode | R Documentation |
Slit a tree at a given internal node into a clade rooted at this node and the remaining tree after dropping this clade
PCMTreeSplitAtNode(
tree,
node,
tableAncestors = PCMTreeTableAncestors(tree),
X = NULL
)
tree |
a PCMTree object. |
node |
an integer or character indicating a root, internal or tip node |
tableAncestors |
an integer matrix returned by a previous call to PCMTreeTableAncestors(tree) or NULL. |
X |
an optional k x N matrix with trait value vectors for each tip in tree. |
In the current implementation, the edge.jump and edge.part members of the tree will be discarded and not present in the clade.
A list containing two named phylo objects:
The subtree (clade) starting at node
.
The portion of X attributable to the tips in clade; NULL if X is NULL.
The tree resulting after dropping all tips in the clade.
The portion of X attributable to the tips in rest; NULL if X is NULL.
set.seed(1, kind = "Mersenne-Twister", normal.kind = "Inversion")
tree <- PCMTree(ape::rtree(25))
if(requireNamespace("ggtree"))
PCMTreePlot(tree) + ggtree::geom_nodelab(angle = 45) +
ggtree::geom_tiplab(angle = 45)
spl <- PCMTreeSplitAtNode(tree, 28)
if(requireNamespace("ggtree"))
PCMTreePlot(PCMTree(spl$clade)) + ggtree::geom_nodelab(angle = 45) +
ggtree::geom_tiplab(angle = 45)
if(requireNamespace("ggtree"))
PCMTreePlot(PCMTree(spl$rest)) + ggtree::geom_nodelab(angle = 45) +
ggtree::geom_tiplab(angle = 45)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.