dot-getRNG: Getting RNG Seeds

Description Usage Arguments Methods (by class)

Description

.getRNG is an S4 generic that extract RNG settings from a variety of object types. Its methods define the workhorse functions that are called by getRNG.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
.getRNG(object, ...)

## S4 method for signature 'ANY'
.getRNG(object, ...)

## S4 method for signature 'missing'
.getRNG(object)

## S4 method for signature 'list'
.getRNG(object)

## S4 method for signature 'numeric'
.getRNG(object, ...)

Arguments

object

an R object from which RNG settings can be extracted, e.g. an integer vector containing a suitable value for .Random.seed or embedded RNG data, e.g., in S3/S4 slot rng or rng$noise.

...

extra arguments to allow extension and passed to a suitable S4 method .getRNG or .setRNG.

Methods (by class)

"ANY": Default method that tries to extract RNG information from object, by looking sequentially to a slot named 'rng', a slot named 'rng.seed' or an attribute names 'rng'.

It returns NULL if no RNG data was found.

"missing": Returns the current RNG settings.

"list": Method for S3 objects, that aims at reproducing the behaviour of the function getRNG of the package getRNG.

It sequentially looks for RNG data in elements 'rng', noise$rng if element 'noise' exists and is a list, or in attribute 'rng'.

"numeric": Method for numeric vectors, which returns the object itself, coerced into an integer vector if necessary, as it is assumed to already represent a value for .Random.seed.


rngtools documentation built on Sept. 20, 2021, 5:08 p.m.