read.tree.string | R Documentation |
This function reads tree strings in Newick format from a tree file. The output of the function is a vector of tree strings that can be converted to a matrix of nodes by the function read.tree.nodes
.
read.tree.string(file = "", format="nexus")
file |
the tree file that contains trees in Newick format. |
format |
format = "nexus" or format = "phylip" |
The function can read NEXUS and PHYLIP tree files. It works for other types of tree files as long as the trees in the tree files are in Newick format. This function combining with write.tree.string
can change the tree file format.
tree |
a vector of tree strings. |
names |
species names. |
root |
TRUE for rooted trees, FALSE for unrooted trees |
Liang Liu lliu@uga.edu
write.tree.string
, read.tree.nodes
##read rooted trees in PHYLIP format
cat("(((H:4.2,C:4.2):3.1,G:7.3):6.3,O:13.5);",file = "phylip.tre", sep = "\n")
tree.string<-read.tree.string("phylip.tre",format="phylip")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.