Restores a generator state, including its kinds, as assigning R's .Random.seed does.
Equivalent to R's .Random.seed.
Parameters
state: ArrayLike<number>
The integers returned by getRandomSeed, or copied from R's .Random.seed.
Returns void
Throws
RangeError for a kind code other than those of Mersenne-Twister or L'Ecuyer-CMRG with
Inversion and Rejection or Rounding (10403, 403, 10407, 407), a state of the wrong
length, or an invalid L'Ecuyer-CMRG state (R reseeds from the clock in these cases).
Example
setSeed(1); consts = getRandomSeed(); runif(2); // [0.2655087, 0.3721239] setRandomSeed(s); runif(2); // [0.2655087, 0.3721239] (the same again)
Restores a generator state, including its kinds, as assigning R's
.Random.seeddoes. Equivalent to R's.Random.seed.