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

Description Usage Arguments Details Value Author(s) References Examples

Description

Functions for generating and working with truly random seeds.

Usage

1
2
3
4
5
6
7
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 runif. 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

http://www.random.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  ## Not run: 
  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)
  
## End(Not run)

kingaa/aakmisc documentation built on Sept. 29, 2018, 9:33 p.m.