always_set_new_or_forced_rand_seed: Always set a seed, either by generating a new one or reusing...

always_set_new_or_forced_rand_seedR Documentation

Always set a seed, either by generating a new one or reusing a given one

Description

Generate a new seed based on the current time if the forced_seed argument is NULL. If that argument is not NULL, then use it as a seed. Regardless of which way the seed is derived, call set.seed() with it as the argument.

Usage

always_set_new_or_forced_rand_seed(location_string, forced_seed = NULL)

Arguments

location_string

string to indicate where this function was called, e.g., at the start of the creation of an rsproblem

forced_seed

integer to use as seed in set.seed() call or NULL to indicate that no seed has been provided

Value

Returns a 2 element named list with element new_seed containing the new integer seed value or NA and the element R_internal_seed_array containing the array value .Random.seed at the end of this function (i.e., the internal state of R's random number generator)


langfob/bdpg documentation built on Dec. 8, 2022, 5:33 a.m.