Description Usage Arguments Details Value See Also Examples
Create a given number of seeds for L'Ecuyer's RNG, that can be used to seed parallel computation, making them fully reproducible.
RNGseq_seed
generates the – next – random seed
used as the first seed in the sequence generated by
RNGseq
.
1 2 3 4 |
n |
Number of streams to be created |
seed |
seed specification used to initialise the set
of streams using |
simplify |
a logical that specifies if sequences of length 1 should be unlisted and returned as a single vector. |
... |
extra arguments passed to
|
normal.kind |
Type of Normal random generator. See
|
verbose |
logical to toggle verbose messages |
version |
version of the function to use, to
reproduce old behaviours. Version 1 had a bug which made
the generated stream sequences share most of their seeds
(!), as well as being not equivalent to calling
|
This ensures complete reproducibility of the set of run.
The streams are created using L'Ecuyer's RNG, implemented
in R core since version 2.14.0 under the name
"L'Ecuyer-CMRG"
(see RNG
).
Generating a sequence without specifying a seed uses a single draw of the current RNG. The generation of a sequence using seed (a single or 6-length numeric) a should not affect the current RNG state.
a list of integer vectors (or a single integer vector if
n=1
and unlist=TRUE
).
a 7-length numeric vector.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | RNGseq(3)
RNGseq(3)
RNGseq(3, seed=123)
# or identically
set.seed(123)
identical(RNGseq(3), RNGseq(3, seed=123))
RNGseq(3, seed=1:6, verbose=TRUE)
# select Normal kind
RNGseq(3, seed=123, normal.kind="Ahrens")
## generate a seed for RNGseq
# random
RNGseq_seed()
RNGseq_seed()
RNGseq_seed(NULL)
# fixed
RNGseq_seed(1)
RNGseq_seed(1:6)
# `RNGseq_seed(1)` is identical to
set.seed(1)
s <- RNGseq_seed()
identical(s, RNGseq_seed(1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.