Learn R Programming

phylogram (version 2.0.1)

as.dendrogram.phylo: Convert "phylo" objects to dendrograms.

Description

These functions are used for converting dendrograms to "phylo" objects and vice versa.

Usage

# S3 method for phylo
as.dendrogram(object, ...)

Arguments

object

a "phylo" object.

...

further arguments to be passed between methods.

Value

an object of class "dendrogram".

Details

These functions currently work by temporarily writing a tree to Newick text and then parsing the string using either read.dendrogram or read.tree. A faster implementation that avoids the transformation to text strings will be available in a future version.

Examples

Run this code
# NOT RUN {
  newick <- "(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);"
  x <- read.dendrogram(text = newick)
  y <- as.phylo(x)
  z <- as.dendrogram(y)
  identical(x, z)
# }

Run the code above in your browser using DataLab