random: Functions for generating and working with truly random...

randomR Documentation

Functions for generating and working with truly random integers.

Description

Functions for generating and working with truly random seeds.

Usage

random.org(n = 10, rnd = "new")

urandom(n = 10)

rngControl(expr, seed = NULL)

rngSeeds(n, seed = NULL)

Arguments

n

Number of integers required.

rnd

random.org parameter

expr

Expression to be evaluated with RNG control.

seed

RNG seed.

Details

random.org gets seeds from random.org.

urandom gets seeds locally from ‘/dev/urandom’ on *nix systems.

rngControl is a function to control RNG for the evaluation of an expression.

rngSeeds generates RNG seeds using sample.int. It is included for situations when neither random.org nor urandom is available.

Value

integers suitable for use as RNG seeds

Author(s)

Aaron A. King

References

https://www.random.org

Examples


random.org(n=5)
seed <- urandom(n=1)
seeds <- rngSeeds(5,seed=seed)
set.seed(seed)
runif(5)
rngControl(runif(5),seed=seed[1])
rngControl(runif(5),seed=seed[1])
runif(5)
set.seed(seed)
runif(5)
runif(5)


kingaa/aakmisc documentation built on Sept. 16, 2024, 9:24 p.m.