]> git.donarmstrong.com Git - ape.git/blobdiff - R/read.tree.R
new as.list.DNAbin
[ape.git] / R / read.tree.R
index aa0b0294e0b695f82d58ab677d3732cd175b0756..efb311709460535abef52f0503d5c8e63360f9df 100644 (file)
@@ -1,4 +1,4 @@
-## read.tree.R (2009-03-29)
+## read.tree.R (2009-04-27)
 
 ##   Read Tree Files in Parenthetic Format
 
@@ -38,7 +38,7 @@ tree.build <- function(tp)
         obj$edge.length <- as.numeric(tp[3])
         obj$Nnode <- 1L
         obj$tip.label <- tp[2]
-        if (length(tp) == 4) obj$node.label <- tp[4]
+        if (tp[4] != "") obj$node.label <- tp[4]
         class(obj) <- "phylo"
         return(obj)
     }
@@ -133,7 +133,7 @@ read.tree <- function(file = "", text = NULL, tree.names = NULL, skip = 0,
 
     tmp <- unlist(lapply(STRING, unname))
     tmpnames <- tmp[c(TRUE, FALSE)]
-    tree <- tmp[c(FALSE, TRUE)]
+    STRING <- tmp[c(FALSE, TRUE)]
     if (is.null(tree.names) && any(nzchar(tmpnames)))
         tree.names <- tmpnames