]> git.donarmstrong.com Git - ape.git/commitdiff
final fix in read.nexus() for ape 2.2-1
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 11 Jul 2008 15:12:16 +0000 (15:12 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 11 Jul 2008 15:12:16 +0000 (15:12 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@42 6e262413-ae40-0410-9e79-b911bd7a66b7

R/read.nexus.R

index 06acd2fb39e4bbb6bf3b76780ff7525d3c37afa3..d2520962f9b99ce8258c3fadca4fc83225400af2 100644 (file)
@@ -1,4 +1,4 @@
-## read.nexus.R (2008-07-09)
+## read.nexus.R (2008-07-11)
 
 ##   Read Tree File in Nexus Format
 
@@ -208,8 +208,11 @@ read.nexus <- function(file, tree.names = NULL)
     }
     if (Ntree == 1) {
         trees <- trees[[1]]
-        if (translation)
-            trees$tip.label <- TRANS[, 2][as.numeric(trees$tip.label)]
+        if (translation) {
+            trees$tip.label <-
+                if (length(colon)) TRANS[, 2] else
+                TRANS[, 2][as.numeric(trees$tip.label)]
+        }
     } else {
         if (!is.null(tree.names)) names(trees) <- tree.names
         if (translation) attr(trees, "TipLabel") <- TRANS[, 2]