move_node: Move a node

move_nodeR Documentation

Move a node

Description

Move one node to a position dominated by a new parent node.

Usage

move_node(phy, label, parent_label)

Arguments

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.

Details

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.

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_node(tree, "iter1240", parent_label = "left1242")
plot_glotto(tree2)

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