set_init_seed: Set RNG seed

View source: R/set_init_seed.R

set_init_seedR Documentation

Set RNG seed

Description

Sets the RNG (random number generator) seed.

Usage

set_init_seed(seed_val)

Arguments

seed_val

One of the following:

  • A single value (which can be interpreted as an integer) to set the RNG;

  • The character literal "random" (to set a random seed);

  • NULL, to re-initialize the RNG as if no seed had yet been set (see 'Details' in set.seed); or

  • NA, in which case the function will return without any change to the seed.

Value

The value of seed_val (either user-supplied or set from within the function), invisibly.

See Also

set.seed, get_random_seed_val

Examples

## Not run: 
set_init_seed(1) # => Set seed to a specific value
set_init_seed("random") # => Set seed to a randomly-generated value
set_init_seed(NULL) # => Re-initialize seed as if none had yet been set
set_init_seed(NA) # => Return immediately without changing seed

## End(Not run)


toniprice/jute documentation built on Jan. 11, 2023, 8:23 a.m.