@@ -329,13 +329,11 @@ runArraySimulation <- function(design, ..., replications,
329329 stopifnot(nrow(design ) > 1L )
330330 stopifnot(" arrayID is not a single integer identifier" =
331331 length(arrayID ) == 1L && is.numeric(arrayID ) && ! is.na(arrayID ))
332+ if (length(replications ) == 1 )
333+ replications <- rep(replications , nrow(design ))
332334 rowpick <- array2row(arrayID )
333335 filename_suffix <- paste0(" -" , rowpick )
334336 stopifnot(! missing(replications ))
335- if (length(replications ) > 1L )
336- replications <- replications [rowpick ]
337- if (length(replications ) == 1 )
338- replications <- rep(replications , length(rowpick ))
339337 stopifnot(rowpick %in% 1L : nrow(design ))
340338 if (! is.null(filename ))
341339 filename <- paste0(filename , filename_suffix )
@@ -354,7 +352,7 @@ runArraySimulation <- function(design, ..., replications,
354352 seed <- genSeeds(design , iseed = iseed , arrayID = row )
355353 dsub <- design [row , , drop = FALSE ]
356354 attr(dsub , ' Design.ID' ) <- attr(design , ' Design.ID' )[row ]
357- ret <- runSimulation(design = dsub , replications = replications [i ], seed = seed ,
355+ ret <- runSimulation(design = dsub , replications = replications [row ], seed = seed ,
358356 verbose = verbose , save_details = save_details ,
359357 parallel = parallel , ncores = ncores , cl = cl ,
360358 control = control , save = FALSE , resume = FALSE , ... )
0 commit comments