read.tree(file = "", format = "Newick", rooted = TRUE,
tree.names = NULL, skip = 0, comment.char = "#", ...)
file = ""
(the default) then the
tree is input on the keyboard, the entry being terminated with a blank line."Newick"
. Currently only the Newick format is available.TRUE
. This is currently not implemented, meaning
that all trees are read as rooted.NULL
(the default), the trees are named "tree1"
,
"tree2"
, ...scan()
).scan()
).scan()
."phylo"
with the following components:"-1"
), and the tips are represented with
positive numbers. For each row, the first column gives the
ancestor. This representation allows an easy manipulation of the
tree, particularly if it is rooted.edge
.edge
.NULL
if not available in the file).NULL
otherwise).c("phylo", "multi.tree")
, and is a list of objects of class "phylo"
.file
allows to type directly the tree on
the keyboard (or possibly to copy from an editor and paste in R's
console) with, e.g., mytree <- read.tree()
.write.tree
, scan
for the basic R
function to read data in a file### An extract from Sibley and Ahlquist (1990)
cat("(((Strix aluco:4.2,Asio otus:4.2):3.1,",
"Athene noctua:7.3):6.3,Tyto alba:13.5);",
file = "ex.tre", sep = "")
tree.owls <- read.tree("ex.tre")
str(tree.owls)
tree.owls
unlink("ex.tre") # delete the file "ex.tre"
Run the code above in your browser using DataLab