]> git.donarmstrong.com Git - ape.git/blobdiff - R/read.nexus.R
cosmetic modif on rtree() + last (?) changes to Damien's functions
[ape.git] / R / read.nexus.R
index 0b0cacc1281ebd6f43350ba8db5457f9fe4434e0..ff148df2eaa1ff9b419f346c3f64d8cc14611718 100644 (file)
@@ -196,7 +196,10 @@ read.nexus <- function(file, tree.names = NULL)
             stop(paste("There is apparently two root edges in your file: cannot read tree file.\n  Reading NEXUS file aborted at tree no.", i, sep = ""))
         }
     }
-    if (Ntree == 1) trees <- trees[[1]] else {
+    if (Ntree == 1) {
+        trees <- trees[[1]]
+        trees$tip.label <- TRANS[, 2]
+    } else {
         if (!is.null(tree.names)) names(trees) <- tree.names
         if (translation) attr(trees, "TipLabel") <- TRANS[, 2]
         class(trees) <- "multiPhylo"