rxWithSeed function

Preserved seed and possibly set the seed

Preserved seed and possibly set the seed

rxWithSeed( seed, code, rxseed = rxGetSeed(), kind = "default", normal.kind = "default", sample.kind = "default" ) rxWithPreserveSeed(code)

Arguments

  • seed: R seed to use for the session

  • code: Is the code to evaluate

  • rxseed: is the rxode2 seed that is being preserved

  • kind: character or NULL. If kind is a character string, set 's RNG to the kind desired. Use "default" to return to the default. See Details for the interpretation of NULL.

  • normal.kind: character string or NULL. If it is a character string, set the method of Normal generation. Use "default"

    to return to the default. NULL makes no change.

  • sample.kind: character string or NULL. If it is a character string, set the method of discrete uniform generation (used in sample, for instance). Use "default" to return to the default. NULL makes no change.

Returns

returns whatever the code is returning

Examples

rxGetSeed() rxWithSeed(1, { print(rxGetSeed()) rxnorm() print(rxGetSeed()) rxnorm() }, rxseed=3)

See Also

rxGetSeed, rxSetSeed