From f887c73c57e9d8508eacc8c03ab0d68b97f409e7 Mon Sep 17 00:00:00 2001 From: philchalmers Date: Thu, 1 Aug 2024 09:42:17 -0400 Subject: [PATCH] update docs --- R/runArraySimulation.R | 21 +++++++++------------ man/runArraySimulation.Rd | 21 +++++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/R/runArraySimulation.R b/R/runArraySimulation.R index c891976e..01c1cdc8 100644 --- a/R/runArraySimulation.R +++ b/R/runArraySimulation.R @@ -7,7 +7,7 @@ #' jobs to HPC clusters where a job array number is available (e.g., via SLURM), #' where the simulation results must be saved to independent files as they #' complete. Use of \code{\link{expandDesign}} is useful for distributing replications -#' to different jobs, while \code{\link{gen_seeds}} is required to ensure high-quality +#' to different jobs, while \code{\link{genSeeds}} is required to ensure high-quality #' random number generation across the array submissions. See the associated #' vignette for a brief tutorial of this setup. #' @@ -17,7 +17,7 @@ #' approach, which uses this method to distribute random seeds within #' each isolated condition rather than between all conditions). As such, this #' function requires the seeds to be generated using -#' \code{\link{gen_seeds}} with the \code{iseed} and \code{arrayID} +#' \code{\link{genSeeds}} with the \code{iseed} and \code{arrayID} #' inputs to ensure that each job is analyzing a high-quality #' set of random numbers via L'Ecuyer-CMRG's (2002) method, incremented using #' \code{\link[parallel]{nextRNGStream}}. @@ -69,11 +69,11 @@ #' will only be useful when \code{ncores > 2} as defined in the shell instruction #' file #' -#' @param iseed initial seed to be passed to \code{\link{gen_seeds}}'s argument +#' @param iseed initial seed to be passed to \code{\link{genSeeds}}'s argument #' of the same name, along with the supplied \code{arrayID} #' #' @param addArrayInfo logical; should the array ID and original design row number -#' be added to the \code{SimExtract(..., what='results')} output? +#' be added to the \code{SimResults(...)} output? #' #' @param array2row user defined function with the single argument \code{arrayID}. #' Used to convert the detected \code{arrayID} @@ -121,12 +121,8 @@ #' with the SimDesign Package. \code{The Quantitative Methods for Psychology, 16}(4), 248-280. #' \doi{10.20982/tqmp.16.4.p248} #' -#' Sigal, M. J., & Chalmers, R. P. (2016). Play it again: Teaching statistics with Monte -#' Carlo simulation. \code{Journal of Statistics Education, 24}(3), 136-156. -#' \doi{10.1080/10691898.2016.1246953} -#' #' @seealso \code{\link{runSimulation}}, \code{\link{expandDesign}}, -#' \code{\link{gen_seeds}}, \code{\link{SimCheck}}, +#' \code{\link{genSeeds}}, \code{\link{SimCheck}}, #' \code{\link{SimCollect}}, \code{\link{getArrayID}} #' #' @examples @@ -176,12 +172,12 @@ #' generate=Generate, analyse=Analyse, #' summarise=Summarise, arrayID=arrayID, #' parallel=TRUE, ncores=3, -#' iseed=iseed, filename='mysim') # saved as 'mysim-1.rds' +#' iseed=iseed, filename='myparsim') #' res #' SimResults(res) # condition and replication count stored #' #' dir() -#' SimClean('mysim-1.rds') +#' SimClean(c('mysim-1.rds', 'myparsim-1.rds')) #' #' ######################## #' # Same submission job as above, however split the replications over multiple @@ -275,7 +271,8 @@ #' #' setwd('sim') #' -#' # note that all row conditions are still stored separately +#' # note that all row conditions are still stored separately, though note that +#' # arrayID is now 2 instead #' condition14 <- readRDS('condition-14.rds') #' condition14 #' SimResults(condition14) diff --git a/man/runArraySimulation.Rd b/man/runArraySimulation.Rd index 56bfeccc..34d1e323 100644 --- a/man/runArraySimulation.Rd +++ b/man/runArraySimulation.Rd @@ -32,7 +32,7 @@ See \code{\link{runSimulation}} for further details} condition (i.e., each row in \code{design}). See \code{\link{runSimulation}} for further details} -\item{iseed}{initial seed to be passed to \code{\link{gen_seeds}}'s argument +\item{iseed}{initial seed to be passed to \code{\link{genSeeds}}'s argument of the same name, along with the supplied \code{arrayID}} \item{filename}{file name to save simulation files to (does not need to @@ -60,7 +60,7 @@ according the SLURM scheduler} \code{function(arrayID){1:10 + 10 * (arrayID-1)}} can be passed to \code{array2row}} \item{addArrayInfo}{logical; should the array ID and original design row number -be added to the \code{SimExtract(..., what='results')} output?} +be added to the \code{SimResults(...)} output?} \item{parallel}{logical; use parallel computations via the a "SOCK" cluster? Only useful when the instruction shell file requires more than 1 core @@ -110,7 +110,7 @@ per independent row condition. This is mainly useful when distributing the jobs to HPC clusters where a job array number is available (e.g., via SLURM), where the simulation results must be saved to independent files as they complete. Use of \code{\link{expandDesign}} is useful for distributing replications -to different jobs, while \code{\link{gen_seeds}} is required to ensure high-quality +to different jobs, while \code{\link{genSeeds}} is required to ensure high-quality random number generation across the array submissions. See the associated vignette for a brief tutorial of this setup. } @@ -121,7 +121,7 @@ array ID submissions (cf. \code{\link{runSimulation}}'s \code{parallel} approach, which uses this method to distribute random seeds within each isolated condition rather than between all conditions). As such, this function requires the seeds to be generated using -\code{\link{gen_seeds}} with the \code{iseed} and \code{arrayID} +\code{\link{genSeeds}} with the \code{iseed} and \code{arrayID} inputs to ensure that each job is analyzing a high-quality set of random numbers via L'Ecuyer-CMRG's (2002) method, incremented using \code{\link[parallel]{nextRNGStream}}. @@ -182,12 +182,12 @@ res <- runArraySimulation(design=Design, replications=50, generate=Generate, analyse=Analyse, summarise=Summarise, arrayID=arrayID, parallel=TRUE, ncores=3, - iseed=iseed, filename='mysim') # saved as 'mysim-1.rds' + iseed=iseed, filename='myparsim') res SimResults(res) # condition and replication count stored dir() -SimClean('mysim-1.rds') +SimClean(c('mysim-1.rds', 'myparsim-1.rds')) ######################## # Same submission job as above, however split the replications over multiple @@ -281,7 +281,8 @@ dir('sim/') setwd('sim') -# note that all row conditions are still stored separately +# note that all row conditions are still stored separately, though note that +# arrayID is now 2 instead condition14 <- readRDS('condition-14.rds') condition14 SimResults(condition14) @@ -302,14 +303,10 @@ SimClean(dirs='sim/') Chalmers, R. P., & Adkins, M. C. (2020). Writing Effective and Reliable Monte Carlo Simulations with the SimDesign Package. \code{The Quantitative Methods for Psychology, 16}(4), 248-280. \doi{10.20982/tqmp.16.4.p248} - -Sigal, M. J., & Chalmers, R. P. (2016). Play it again: Teaching statistics with Monte -Carlo simulation. \code{Journal of Statistics Education, 24}(3), 136-156. -\doi{10.1080/10691898.2016.1246953} } \seealso{ \code{\link{runSimulation}}, \code{\link{expandDesign}}, - \code{\link{gen_seeds}}, \code{\link{SimCheck}}, + \code{\link{genSeeds}}, \code{\link{SimCheck}}, \code{\link{SimCollect}}, \code{\link{getArrayID}} } \author{