]> git.donarmstrong.com Git - ape.git/blobdiff - R/read.tree.R
final commit for ape 3.0-8
[ape.git] / R / read.tree.R
index 87ae296e8f7d9fb33ff7843cb60c27fc15a062f6..47a432c39793e6b58ceef307e4248d588b1c6249 100644 (file)
@@ -1,8 +1,8 @@
-## read.tree.R (2010-09-27)
+## read.tree.R (2012-09-14)
 
 ##   Read Tree Files in Parenthetic Format
 
-## Copyright 2002-2010 Emmanuel Paradis, Daniel Lawson and Klaus Schliep
+## Copyright 2002-2012 Emmanuel Paradis, Daniel Lawson and Klaus Schliep
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -95,6 +95,7 @@ tree.build <- function(tp)
     if (any(nzchar(node.label))) obj$node.label <- node.label
     if (!is.na(root.edge)) obj$root.edge <- root.edge
     class(obj) <- "phylo"
+    attr(obj, "order") <- "cladewise"
     obj
 }
 
@@ -158,7 +159,7 @@ read.tree <- function(file = "", text = NULL, tree.names = NULL, skip = 0,
         ## is a bifurcation at the root
         ROOT <- length(obj[[i]]$tip.label) + 1
         if(sum(obj[[i]]$edge[, 1] == ROOT) == 1 && dim(obj[[i]]$edge)[1] > 1)
-            stop(paste("There is apparently two root edges in your file: cannot read tree file.\n  Reading Newick file aborted at tree no.", i, sep = ""))
+            stop(paste("The tree has apparently singleton node(s): cannot read tree file.\n  Reading Newick file aborted at tree no.", i))
     }
     if (Ntree == 1 && !keep.multi) obj <- obj[[1]] else {
         if (!is.null(tree.names)) names(obj) <- tree.names