setRNG {setRNG}R Documentation

Set the random number generator

Description

Set the random number generator.

Usage

    setRNG(kind=NULL, seed=NULL, normal.kind=NULL)
    random.number.test()
    

Arguments

None required

kind a character string.
seed a vector of numbers (depending on kind).
normal.kind a character string.

Details

Sets the uniform and normal random number generators and the seed. The function random.number.test() can be used to check that the function is working properly. The old setting is returned in a format which can be used in another call to setRNG. (This would reset to the original value.) If no arguments are given the current setting is returned. In R see RNGkind for more details.

Value

The old setting.

See Also

set.seed RNGkind runif rnorm

Examples

setRNG(kind="Wichmann-Hill", seed=c(979,1479,1542), normal.kind="Box-Muller")
rnorm(10)

[Package Contents]