read.newick | R Documentation |
Reads a phylogenetic tree from file.
read.newick(file="", text, ...)
readNexus(file="", format=c("standard","raxml"))
file |
name of text file with single Newick style tree or multiple trees, one per line. For |
text |
character string containing tree. |
format |
file format (source) for |
... |
optional arguments to be passed to |
The function read.newick
reads a simple Newick style tree from file. This function is now almost completely redundant with read.tree
. At the time of development, however, it was more 'robust' than read.tree
in that it didn't fail if the tree contained so-called 'singles' (nodes with only one descendant); however, read.tree
can now handle singleton nodes without difficulty.
The function readNexus
reads a Nexus formatted tree, optionally with bootstrap values as node labels. This function can read a simple Nexus formatted tree from file (like read.nexus
); however, it can also parse the node labels as bootstrap values. This is the output format from the software RAxML. For Nexus tree files with complex node labels (e.g., from the software MrBayes) it will probably fail to parse node labels correctly, if at all.
An object of class "phylo"
, possibly containing singletons (see collapse.singles
); or an object of class "multiPhylo"
.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
read.tree
, read.nexus
tree<-"((Human,Chimp),Gorilla),Monkey);"
phy<-read.newick(text=tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.