Skip to contents

This function wraps the read.tree parser from the ape package to read a phylogenetic tree from parenthetic text in the Newick/New Hampshire format, and converts it to object of class "dendrogram".


read.dendrogram(file = "", text = NULL, ...)



character string giving a valid path to the file from which to read the data.


optional character string in lieu of a "file" argument. If a text argument is provided instead of a file path, the data are read via a text connection.


further arguments to be passed to read.tree (which may then be passed on to scan).


an object of class "dendrogram".


Felsenstein J (1986) The Newick tree format.

Olsen G (1990) Interpretation of the "Newick's 8:45" tree format standard.

Paradis E, Claude J, Strimmer K, (2004) APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20, 289-290.

Paradis E (2008) Definition of Formats for Coding Phylogenetic Trees in R.

Paradis E (2012) Analysis of Phylogenetics and Evolution with R (Second Edition). Springer, New York.

See also

write.dendrogram writes an object of class "dendrogram" to a Newick text string. The read.tree function in the ape package parses objects of class "phylo" and "multiPhylo".


Shaun Wilkinson


  x <- read.dendrogram(text = "(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);")
  plot(x, horiz = TRUE)