Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulationResult

Create a simulation result, including first and last state


Description

The class "simulationResult" and the function of the same name record an arbitrary simulation result, along with the state of the random number generators at the start and at the end of the simulation, allowing trustworthy verification or repetition of the simulation.

Usage

simulationResult(value, seed)

resetSeed(object, last = FALSE)

Arguments

value

The simulation to be done and saved.

seed

Optionally, the argument to set.seed(), to set the first state of the generator. If omitted, the generator should have been initialized before the call, and the current value of .Random.seed will be used.

object

An object from the "simulationResult" class, usually from a call to the simulationResult() function.

last

Optional flag, if TRUE, then the generator is reset from the last state of object, otherwise from the first.

Value

Function simulationResult returns an object of that class, with the expr and result slots set to the unevaluated and evaluated version of the value argument.

Slots

firstState, lastState:

Objects of class "randomGeneratorState", containing the state of the generator before and after the simulation.

expr:

The expression evaluated to produce the simulation.

result:

The object returned by the simulation.

See Also


SoDA

Functions and Examples for "Software for Data Analysis"

v1.0-6.1
GPL (>= 2)
Authors
John M Chambers
Initial release
2014-06-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.