Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

uchecks

Checking RNG Differences in Unit Tests


Description

checkRNG checks if two objects have the same RNG settings and should be used in unit tests, e.g., with the RUnit package.

Usage

checkRNG(x, y = getRNG(), ...)

Arguments

x, y

objects from which RNG settings are extracted.

...

extra arguments passed to checkTrue.

Examples

#--- checkRNG ---

# check for differences in RNG
set.seed(123)
checkRNG(123)
try( checkRNG(123, 123) )
try( checkRNG(123, 1:3) )

rngtools

Utility Functions for Working with Random Number Generators

v1.5
GPL-3
Authors
Renaud Gaujoux [aut, cre], Max Kuhn [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.