read.tree.string: Read tree strings from a tree file

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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.

Usage

1
read.tree.string(file = "", format="nexus")

Arguments

file

the tree file that contains trees in Newick format.

format

format = "nexus" or format = "phylip"

Details

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.

Value

tree

a vector of tree strings.

names

species names.

root

TRUE for rooted trees, FALSE for unrooted trees

Author(s)

Liang Liu lliu@uga.edu

See Also

write.tree.string, read.tree.nodes

Examples

1
2
3
##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")

bomeara/phybase documentation built on May 12, 2019, 11:35 p.m.