relabel_tip: Change tip labels

View source: R/labels.R

relabel_tipR Documentation

Change tip labels

Description

Replaces existing tip labels with new labels.

Usage

relabel_tip(phy, label, new_label)

Arguments

phy

A phylo object.

label

A vector of strings, the tip labels to be replaced.

new_label

A vector of strings, the same length as label. The corresponding replacement labels.

Examples


library(ape)

tree <- relabel_with_names(get_glottolog_trees("Tangkic"))
plot(tree)
tree2 <- relabel_tip(tree, "Kangkalita", "Gangalidda")
plot(tree2)

tree3 <- clone_tip(tree, "Yangkaal", subgroup = TRUE)
plot(tree3)
tree4 <- apply_duplicate_suffixes(tree3)
plot(tree4)
tree5 <- relabel_tip(tree4, c("Kangkalita", "Yangkaal-1", "Yangkaal-2"), 
                     c("Gangalidda", "Yangkaal", "Yangarella"))
plot(tree5)                

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