Skip to content

Commit 2c784c6

Browse files
committed
add verbose flag for non-interactive use (see #43)
1 parent c6cf466 commit 2c784c6

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

R/runArraySimulation.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
#'
112112
#' @param ... additional arguments to be passed to \code{\link{runSimulation}}
113113
#'
114+
#' @param verbose logical; pass a verbose flag to \code{\link{runSimulation}}.
115+
#' Unlike \code{\link{runSimulation}} this is set to FALSE during interactive
116+
#' sessions, though set to TRUE when non-interactive and information about the
117+
#' session itself should be stored (e.g., in SLURM \code{.out} files)
118+
#'
114119
#' @export
115120
#'
116121
#' @author Phil Chalmers \email{rphilip.chalmers@@gmail.com}
@@ -289,8 +294,8 @@ runArraySimulation <- function(design, ..., replications,
289294
addArrayInfo = TRUE,
290295
parallel = FALSE, cl = NULL,
291296
ncores = parallelly::availableCores(omit = 1L),
292-
save_details = list(),
293-
control = list()){
297+
save_details = list(), control = list(),
298+
verbose = ifelse(interactive(), FALSE, TRUE)){
294299
dots <- list(...)
295300
if(parallel && ncores == 1L) parallel <- FALSE
296301
if(!is.null(dots$save_results) && isTRUE(dots$save_results))
@@ -339,7 +344,7 @@ runArraySimulation <- function(design, ..., replications,
339344
dsub <- design[row, , drop=FALSE]
340345
attr(dsub, 'Design.ID') <- attr(design, 'Design.ID')[row]
341346
ret <- runSimulation(design=dsub, replications=replications, seed=seed,
342-
verbose=FALSE, save_details=save_details,
347+
verbose=verbose, save_details=save_details,
343348
parallel=parallel, cl=cl,
344349
control=control, save=FALSE, ...)
345350
attr(ret, 'extra_info')$number_of_conditions <- nrow(design)

man/runArraySimulation.Rd

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)