rStats.js v1.3.0
    Preparing search index...

    Function getRandomSeed

    • Returns a copy of the current generator state, as reading R's .Random.seed does. Equivalent to R's .Random.seed.

      Returns Int32Array

      The same integers as R's .Random.seed: the kind code (10403 for R's default, 403 with sampleKind: "Rounding", 10407 for L'Ecuyer-CMRG), followed by 625 integers for Mersenne-Twister or 6 for L'Ecuyer-CMRG (unsigned seeds of 2^31 or more appear as negative numbers, as in R). Pass it to setRandomSeed to restore the state.

      setSeed(1);
      const s = getRandomSeed();
      s.length; // 626
      s[0]; // 10403