convert_to_tip: Convert nodes to tips

convert_to_tipR Documentation

Convert nodes to tips

Description

For nodes identified by their label, remove the clade that they dominate and replace it with a tip of the same name.

Usage

convert_to_tip(phy, label, warn = TRUE)

Arguments

phy

A phylo object. The tree to manipulate.

label

A character vector containing node or tip labels.

warn

A logical, whether to issue warning when label cantains tip labels.

Details

Any labels included in label which are both node labels and tip labels are regarded as node label, and that node will be removed and replaced by a tip.

Any labels included in label which are tip labels only are ignored.

Value

A phylo object containing the modified tree.

Examples


tree1 <- abridge_labels(get_glottolog_trees("GreatAndamanese"))
plot_glotto(tree1)
tree2 <- convert_to_tip(tree1, label = c("okol1242", "sout2683"))
plot_glotto(tree2)

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