move_node | R Documentation |
Move one node to a position dominated by a new parent node.
move_node(phy, label, parent_label)
phy |
A phylo object. The tree to manipulate. |
label |
A character string containing the label of the node to move. |
parent_label |
A character string containing the label of the new parent node. |
The branch length above the moved node remains unchanged.
If moving the node would result in any other node(s) having no descendant tips, then those other nodes are removed.
A phylo object containing the modified tree.
library(ape)
tree <- abridge_labels(get_glottolog_trees("LeftMay"))
tree <- ultrametricize(rescale_branches_exp(tree))
plot_glotto(tree)
tree2 <- move_node(tree, "iter1240", parent_label = "left1242")
plot_glotto(tree2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.