tree.translate: Translates all labels in the tree based on a list of label...

Description Usage Arguments Value Examples

Description

Translates all labels in the tree based on a list of label mappings.

Usage

1
  tree.translate(phylo, map)

Arguments

phylo

input phylo object

map

a list of key-value pairs by which to translate node labels

Value

phylo, the original tree with all matching labels mapped to their new values.

Examples

1
2
3
4
5
# Translate a tree of NCBI taxa to their common names
taxon.tree <- tree.read('((9606,9598),9593);')
taxon.map <- list('9606'='Human', '9598'='Chimpanzee', '9593'='Gorilla')
readable.tree <- tree.translate(taxon.tree, taxon.map)
print(as.character(readable.tree)) # ((Human,Chimpanzee),Gorilla)

gjuggler/ggphylo documentation built on May 17, 2019, 6:05 a.m.