initRandomSeed: Initialize the Random Number Seed

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/initRandomSeed.R

Description

This routine will initialize .Random.seed to the desired seed, continue the current seed, or if none exists, set via the clock time.

Usage

1
initRandomSeed(startSeed = NA, runQuiet = TRUE, ...)

Arguments

startSeed

NULL or NA: default to current stream, unless .Random.seed does not exit, in which case the seed is set from the system clock time; otherwise, specify a scalar seed value start a new stream.

runQuiet

TRUE: no feedback; FALSE: show some results.

...

Not used, for gobbling arguments only.

Details

The default uniform RNG in R is“Mersenne-Twister” which produces a ‘seed set’ when initialized. This seed set seems to be initialized to postion 624 so that the next draw will change the seed set (and hence the position to 1). Subsequently it will take 624 more draws to change the seed set, to a new one &c. So what is returned by default from this function is a vector of length 626.

Value

The newly set seed or current seed invisibly.

Author(s)

Jeffrey H. Gove

See Also

.Random.seed, set.seed

Examples

1
2
3
4
5
6
7
## Not run: 
initRandomSeed()
initRandomSeed(12)
rm(.Random.seed)
initRandomSeed(NULL)

## End(Not run)

sampSurf documentation built on March 5, 2021, 5:06 p.m.