as.Newick | R Documentation |
as.Newick()
creates a character string representation of a phylogenetic
tree, in the Newick format, using R's internal tip numbering.
Use RenumberTips()
to ensure that the internal numbering follows the
order you expect.
as.Newick(x)
## S3 method for class 'phylo'
as.Newick(x)
## S3 method for class 'list'
as.Newick(x)
## S3 method for class 'multiPhylo'
as.Newick(x)
x |
Object to convert to Newick format. See Usage section for supported classes. |
as.Newick()
returns a character string representing tree
in Newick
format.
Martin R. Smith (martin.smith@durham.ac.uk)
Retain leaf labels: NewickTree()
Change R's internal numbering of leaves: RenumberTips()
Write tree to text or file: ape::write.tree()
trees <- list(BalancedTree(1:8), PectinateTree(8:1))
trees <- lapply(trees, RenumberTips, 1:8)
as.Newick(trees)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.