From: paradis Date: Fri, 11 Jul 2008 15:12:16 +0000 (+0000) Subject: final fix in read.nexus() for ape 2.2-1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e45ffadf622e6b0569cec89d391a6f0866f6b603;p=ape.git final fix in read.nexus() for ape 2.2-1 git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@42 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/R/read.nexus.R b/R/read.nexus.R index 06acd2f..d252096 100644 --- a/R/read.nexus.R +++ b/R/read.nexus.R @@ -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]