Learn R Programming

simsalapar (version 1.0-2)

subjob: Function for Computing one Row of the Virtual Grid (Subjob)

Description

subjob() computes one row of the virtual grid in a simulation study, provides several seeding methods, and sub-job monitoring (information about the sub-job just finished).

printInfo is a named list of functions optionally to be used as monitor in subjob() for printing information at the end of each sub-job.

Usage

subjob(i, pGrid, nonGrids, n.sim, seed, keepSeed = FALSE,
       repFirst = TRUE, doOne,
       timer = mkTimer(gcFirst=FALSE), monitor = FALSE, ...)

printInfo # or # printInfo[["default"]]

Arguments

i
row number of the virtual grid. i.sim and j together determine i.
pGrid
physical grid of all combinations of variables of type "grid", as returned by mkGrid().
nonGrids
values of non-"grid"-variables (if provided, passed to doOne()), i.e., typically get.nonGrids(*)[["nonGrids"]].
n.sim
number of simulation replications.
seed
one of: [object Object],[object Object],[object Object],[object Object],[object Object]
keepSeed
logical indicating if .Random.seed should be appended to each return value of doCallWE().
repFirst
logical; if TRUE (the default), all n.sim replications are computed for a row in the (physical) grid first, before the next row is consider
doOne
function for computing one row in the (physical) grid; must return a numeric vector, matrix, or array.
timer
a function similar to system.time(), passed to doCallWE().
monitor
logical indicating whether a monitor is displayed.
...
additional arguments passed to doOne().

Value

  • [object Object],[object Object]

Details

See the vignette or references in simsalapar-package for how to use these functions.

See Also

doCallWE(); .Random.seed for information about random number generators and seeds.

For examples of implicit use of subjob, see doLapply.