These functions are convenience wrappers that may allow for more efficient Caching. Passes all arguments to simInit, then passes the created simList to spades or experiment.

simInitAndSpades(times, params, modules, objects, paths, inputs, outputs,
  loadOrder, notOlderThan, debug, progress, cache, .plotInitialTime,
  .saveInitialTime, ...)

simInitAndExperiment(times, params, modules, objects, paths, inputs,
  outputs, loadOrder, notOlderThan, replicates, dirPrefix, substrLength,
  saveExperiment, experimentFile, clearSimEnv, cl, ...)

Arguments

times

A named list of numeric simulation start and end times (e.g., times = list(start = 0.0, end = 10.0)).

params

A list of lists of the form list(moduleName=list(param1=value, param2=value)). See details.

modules

A named list of character strings specifying the names of modules to be loaded for the simulation. Note: the module name should correspond to the R source file from which the module is loaded. Example: a module named "caribou" will be sourced form the file caribou.R, located at the specified modulePath(simList) (see below).

objects

(optional) A vector of object names (naming objects that are in the calling environment of the simInit, which is often the .GlobalEnv unless used programmatically -- NOTE: this mechanism will fail if object name is in a package dependency), or a named list of data objects to be passed into the simList (more reliable). These objects will be accessible from the simList as a normal list, e.g,. mySim$obj.

paths

An optional named list with up to 4 named elements, modulePath, inputPath, outputPath, and cachePath. See details.

inputs

A data.frame. Can specify from 1 to 6 columns with following column names: objectName (character, required), file (character), fun (character), package (character), interval (numeric), loadTime (numeric). See inputs and vignette("ii-modules") section about inputs.

outputs

A data.frame. Can specify from 1 to 5 columns with following column names: objectName (character, required), file (character), fun (character), package (character), saveTime (numeric). See outputs and vignette("ii-modules") section about outputs.

loadOrder

An optional list of module names specifying the order in which to load the modules. If not specified, the module load order will be determined automatically.

notOlderThan

A time, as in from Sys.time(). This is passed into the Cache function that wraps .inputObjects. If the module uses the .useCache parameter and it is set to TRUE or ".inputObjects", then the .inputObjects will be cached. Setting notOlderThan = Sys.time() will cause the cached versions of .inputObjects to be refreshed, i.e., rerun.

debug

Optional logical flag or character vector indicating what to print to console at each event. See details. Default is to use the value in getOption("spades.debug").

progress

Logical (TRUE or FALSE show a graphical progress bar), character ("graphical", "text") or numeric indicating the number of update intervals to show in a graphical progress bar.

cache

Logical. If TRUE, then the spades call will be cached. This means that if the call is made again with the same simList, then `spades`` will return the return value from the previous run of that exact same simList. Default FALSE. See Details. See also the vignette on caching for examples.

.plotInitialTime

Numeric. Temporarily override the .plotInitialTime parameter for all modules. See Details.

.saveInitialTime

Numeric. Temporarily override the .plotInitialTime parameter for all modules. See Details.

...

Arguments passed to simInit, and spades or experiment

replicates

The number of replicates to run of the same simList. See details and examples.

dirPrefix

String vector. This will be concatenated as a prefix on the directory names. See details and examples.

substrLength

Numeric. While making outputPath for each spades call, this is the number of characters kept from each factor level. See details and examples.

saveExperiment

Logical. Should params, modules, inputs, sim, and resulting experimental design be saved to a file. If TRUE are saved to a single list called experiment. Default TRUE.

experimentFile

String. Filename if saveExperiment is TRUE; saved to outputPath(sim) in .RData format. See Details.

clearSimEnv

Logical. If TRUE, then the envir(sim) of each simList in the return list is emptied. This is to reduce RAM load of large return object. Default FALSE.

cl

A cluster object. Optional. This would generally be created using parallel::makeCluster or equivalent. This is an alternative way, instead of beginCluster(), to use parallelism for this function, allowing for more control over cluster use.

Value

Same as spades (a simList) or experiment (list of simList objects)

Details

simInitAndExperiment cannot pass modules or params to experiment because these are also in simInit. If the experiment is being used to vary these arguments, it must be done separately (i.e., simInit then experiment).

See also