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)

YuLab-SMU/treeio documentation built on Nov. 3, 2024, 4:17 p.m.