# 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)
Run the code above in your browser using DataLab