move_tip: Move a tip

move_tipR Documentation

Move a tip

Description

Move one tip to a new parent node.

Usage

move_tip(phy, label, parent_label)

Arguments

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.

Details

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.

Value

A phylo object containing the modified tree.

Examples


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)

erichround/glottoTrees documentation built on April 17, 2025, 10:47 a.m.