Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

as.Newick

Write a phylogenetic tree in Newick format


Description

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.

Usage

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)

Arguments

x

Object to convert to Newick format. See Usage section for supported classes.

Value

as.Newick() returns a character string representing tree in Newick format.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

Examples

trees <- list(BalancedTree(1:8), PectinateTree(8:1))
trees <- lapply(trees, RenumberTips, 1:8)
as.Newick(trees)

TreeTools

Create, Modify and Analyse Phylogenetic Trees

v1.4.4
GPL (>= 3)
Authors
Martin R. Smith [aut, cre, cph] (<https://orcid.org/0000-0001-5660-1727>), Emmanuel Paradis [cph] (<https://orcid.org/0000-0003-3092-2199>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.