This vignette demonstrates one of the newer features in the SimDesign
package pertaining to multiple analysis function definitions that can be selected for each Design
condition or whenever they are applicable. The purpose of providing multiple analysis functions is to
Analyse()
function contains too much code to easily track, and toFunctionality speaking, this type of organization does not change how SimDesign
generally operates. For that reason, the coding style presented in this vignette can be considered optional. However, if any of the above points resonate well with you then following the details of this coding organization style may prove useful.
The usual work-flow with SimDesign
requires first calling SimFunctions()
to generate a working template, such as the following.
SimDesign::SimFunctions()
## #-------------------------------------------------------------------
##
## library(SimDesign)
##
## Design <- createDesign(factor1 = NA,
## factor2 = NA)
##
## #-------------------------------------------------------------------
##
## Generate <- function(condition, fixed_objects = NULL) {
## dat <- data.frame()
## dat
## }
##
## Analyse <- function(condition, dat, fixed_objects = NULL) {
## ret <- c(stat1 = NaN, stat2 = NaN)
## ret
## }
##
## Summarise <- function(condition, results, fixed_objects = NULL) {
## ret <- c(bias = NaN, RMSE = NaN)
## ret
## }
##
## #-------------------------------------------------------------------
##
## res <- runSimulation(design=Design, replications=1000, generate=Generate,
## analyse=Analyse, summarise=Summarise)
## res
which uses the default