From 82d3ebca4d04738cd837f24940a7c7e9decb0a0a Mon Sep 17 00:00:00 2001 From: philchalmers Date: Tue, 10 Dec 2024 16:09:13 -0500 Subject: [PATCH] test fix --- R/SimCollect.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/SimCollect.R b/R/SimCollect.R index 7ccc04b..31057fc 100644 --- a/R/SimCollect.R +++ b/R/SimCollect.R @@ -193,7 +193,8 @@ SimCollect <- function(dir=NULL, files = NULL, filename = NULL, tmp <- try(readRDS(filenames[i]), TRUE) if(is(tmp, 'try-error')) stop(c('Could not read file ', filenames[i])) - readin[[i]] <- if(!is.null(select) && select %in% c('ERRORS', 'WARNINGS')){ + readin[[i]] <- if(!is.null(select) && length(select) == 1L && + any(select %in% c('ERRORS', 'WARNINGS'))){ SimExtract(tmp, what=tolower(select)) } else subset_results(tmp, select=select) if(gc){ @@ -201,7 +202,8 @@ SimCollect <- function(dir=NULL, files = NULL, filename = NULL, gc() } } - if(!is.null(select) && select %in% c('ERRORS', 'WARNINGS')) return(readin) + if(!is.null(select) && length(select) == 1L && + any(select %in% c('ERRORS', 'WARNINGS'))) return(readin) extra_info1 <- attr(readin[[1L]], 'extra_info') ncores <- sum(sapply(readin, function(x) attr(x, 'extra_info')$ncores)) extra_info1[c("seeds", "date_completed", "summarise_list", "stored_results",