[Phylobase-commits] r598 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Aug 27 03:43:04 CEST 2009
Author: francois
Date: 2009-08-27 03:43:02 +0200 (Thu, 27 Aug 2009)
New Revision: 598
Modified:
pkg/R/readNexus.R
Log:
fix bug 608, apparently ifelse and lapply aren't compatible
Modified: pkg/R/readNexus.R
===================================================================
--- pkg/R/readNexus.R 2009-08-26 19:11:13 UTC (rev 597)
+++ pkg/R/readNexus.R 2009-08-27 01:43:02 UTC (rev 598)
@@ -183,6 +183,7 @@
tree <- gsub("^.*= *", "", tree)
semico <- grep(";", tree)
Ntree <- length(semico)
+
## are some trees on several lines?
if (any(diff(semico) != 1)) {
STRING <- character(Ntree)
@@ -202,9 +203,11 @@
}
else {
if (length(colon) == Ntree) {
- trees <- ifelse(translation,
- lapply(STRING, .treeBuildWithTokens),
- lapply(STRING, tree.build))
+ if (translation)
+ trees <- lapply(STRING, .treeBuildWithTokens)
+ else
+ trees <- lapply(STRING, tree.build)
+
}
else {
trees <- vector("list", Ntree)
More information about the Phylobase-commits
mailing list