rename_taxa: rename_taxa

View source: R/rename.R

rename_taxaR Documentation

rename_taxa

Description

rename tip label of phylogenetic tree

Usage

rename_taxa(tree, data, key = 1, value = 2)

Arguments

tree

tree object, either treedata or phylo

data

data frame

key

column in data that match tip label (use 1st column by default)

value

column in data for rename tip label (use 2nd column by default)

Value

tree object

Author(s)

Guangchuang Yu

Examples

tree <- rtree(3)
d <- data.frame(old = paste0('t', 1:3), new = LETTERS[1:3])
rename_taxa(tree, d)
rename_taxa(tree, d, old, new)

GuangchuangYu/treeio documentation built on Oct. 31, 2024, 10:13 a.m.