From 00e12010884244ca4aa75d664e7ca9f0c1a9f6da Mon Sep 17 00:00:00 2001 From: philchalmers Date: Fri, 6 Dec 2024 10:50:32 -0500 Subject: [PATCH] santity check (closes #49) --- R/SimCollect.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/SimCollect.R b/R/SimCollect.R index 7d9ed6f..994c245 100644 --- a/R/SimCollect.R +++ b/R/SimCollect.R @@ -298,6 +298,9 @@ SimCollect <- function(dir=NULL, files = NULL, filename = NULL, reps_bad <- out$REPLICATIONS != target.reps if(any(reps_bad)){ diff <- target.reps - out$REPLICATIONS + if(diff < 0) + stop('target.reps is less than the number of replications collected', + call.=FALSE) out$MISSED_REPLICATIONS <- as.integer(diff) out$TARGET_REPLICATIONS <- as.integer(target.reps) out$REPLICATIONS <- NULL