move_tip | R Documentation |
Move one tip to a new parent node.
move_tip(phy, label, parent_label)
phy |
A phylo object. The tree to manipulate. |
label |
A character string containing the tip label. |
parent_label |
A character string containing the label of the parent node. |
In the tip's new position, the length of the branch above it is the same as the longest branch above any new sister of the tip.
If moving the tip would result in any node(s) having no descendant tips, then those 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_tip(tree, "amap1240", parent_label = "left1242")
plot_glotto(tree2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.