randomness: Tests the randomness of a numeric vector or matrix

Description Usage Arguments Value Examples

View source: R/randtest.R

Description

Runs several visual and statistical checks to determine if a given vector is truly random.

Usage

1
randomness(x, n_max = 5000)

Arguments

x

A numeric vector.

n_max

A number indicating the maximum lines in x for which a lag.plot() should be generated.

Value

A number indicating statistical randomness

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Hopefully random distributions
x <- runif(100)
randomness(x)
x <- rnorm(100)
randomness(x)

# True random numbers
if (require(random)) {
  x <- randomNumbers()
  randomness(x)
}

# Non-random sequences
x <- sin((1:100)/pi)
randomness(x)
x <- 1:100
randomness(x)

tomhopper/randr documentation built on Nov. 8, 2021, 2:01 p.m.