Learn R Programming

SimDesign (version 0.3)

main: Main subroutine

Description

This function runs one condition at a time exactly once. This is for repeating the simulation for each condition a number of times, and is where the Monte Carlo flow is controlled. Generally speaking, you shouldn't need to edit this function.

Usage

main(index, condition, generate, analyse)

Arguments

index
an integer place-holder value indexed from the 1:each input
condition
a single row from the design input (as a data.frame), indicating the simulation conditions
generate
the generate function defined above (required for parallel computing)
analyse
the analyse function defined above (required for parallel computing)

Value

  • must return a named list with the 'result' and 'parameters' elements for the computational results and parameters from generate

Examples

Run this code
# This is the default main function
print(SimDesign::main)

Run the code above in your browser using DataLab