[Phylobase-commits] r930 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue May 6 22:16:38 CEST 2014
Author: francois
Date: 2014-05-06 22:16:38 +0200 (Tue, 06 May 2014)
New Revision: 930
Modified:
pkg/R/checkdata.R
Log:
added test for reticulation (apparently forgotten)
Modified: pkg/R/checkdata.R
===================================================================
--- pkg/R/checkdata.R 2014-04-09 20:05:13 UTC (rev 929)
+++ pkg/R/checkdata.R 2014-05-06 20:16:38 UTC (rev 930)
@@ -69,12 +69,12 @@
## Storage of error/warning messages
err <- wrn <- character(0)
-
+
## Matrix is integer
if (!is.integer(object at edge)) {
err <- c(err, "Edge matrix needs to be integer.")
}
-
+
## Matrix doesn't have NAs
if (any(is.na(object at edge))) {
err <- c(err, "Edge matrix cannot have NAs at this time.",
@@ -102,6 +102,16 @@
res <- checkTreeCpp(object, opts=opt)
+ if (hasRetic(object)) {
+ msg <- "Tree is reticulated."
+ if (identical(opt$retic, "fail")) {
+ err <- c(err, msg)
+ }
+ if (identical(opt$retic, "warn")) {
+ wrn <- c(wrn, msg)
+ }
+ }
+
if (hasEdgeLength(object) && any(is.na(edgeLength(object)))) {
naElen <- names(which(is.na(object at edge.length)))
if (! identical(naElen, edgeId(object, "root")))
More information about the Phylobase-commits
mailing list