272272# ' # list saved files
273273# ' dir('sim/')
274274# '
275+ # ' # Also works if the replication input were a suitable vector (not run)
276+ # ' if(FALSE){
277+ # ' reps <- c(rep(10, 14), 100)
278+ # ' cbind(Design5, reps)
279+ # ' sapply(1:3, \(arrayID)
280+ # ' runArraySimulation(design=Design5, replications=reps,
281+ # ' generate=Generate, analyse=Analyse,
282+ # ' summarise=Summarise, iseed=iseed, arrayID=arrayID,
283+ # ' filename='condition', dirname='sim', array2row=array2row)) |> invisible()
284+ # ' }
285+ # '
286+ # '
275287# ' # note that all row conditions are still stored separately, though note that
276288# ' # arrayID is now 2 instead
277289# ' condition14 <- readRDS('sim/condition-14.rds')
@@ -322,6 +334,8 @@ runArraySimulation <- function(design, ..., replications,
322334 stopifnot(! missing(replications ))
323335 if (length(replications ) > 1L )
324336 replications <- replications [rowpick ]
337+ if (length(replications ) == 1 )
338+ replications <- rep(replications , length(rowpick ))
325339 stopifnot(rowpick %in% 1L : nrow(design ))
326340 if (! is.null(filename ))
327341 filename <- paste0(filename , filename_suffix )
@@ -340,7 +354,7 @@ runArraySimulation <- function(design, ..., replications,
340354 seed <- genSeeds(design , iseed = iseed , arrayID = row )
341355 dsub <- design [row , , drop = FALSE ]
342356 attr(dsub , ' Design.ID' ) <- attr(design , ' Design.ID' )[row ]
343- ret <- runSimulation(design = dsub , replications = replications , seed = seed ,
357+ ret <- runSimulation(design = dsub , replications = replications [ i ] , seed = seed ,
344358 verbose = verbose , save_details = save_details ,
345359 parallel = parallel , ncores = ncores , cl = cl ,
346360 control = control , save = FALSE , resume = FALSE , ... )
0 commit comments