with_seed | R Documentation |
Evaluates expression with a seed and resets to initial seed state on exit
with_seed(
expr,
seed = NA_integer_,
kind = NULL,
normal.kind = NULL,
sample.kind = NULL
)
expr |
expression to evaluate. |
seed |
a single value, interpreted as an integer, or NULL, with the exception that NA can be provided to prevent passing 'seed' argument. Default is NA_integer_. |
kind |
character or NULL. If kind is a character string, set R's RNG to the kind desired. Use "default" to return to the R default. |
normal.kind |
character string or NULL. If it is a character string, set the method of Normal generation. Use "default" to return to the R default. NULL makes no change. |
sample.kind |
character string or NULL. If it is a character string, set the method of discrete uniform generation (used in sample, for instance). Use "default" to return to the R default. NULL makes no change. Only applies on R version >= 3.6.0. |
see ‘Details’, from set.seed, with the exception of 'seed'. Using seed = NA_integer_, NOTHING will be passed to set.seed nor RNGkind and NOTHING will be restored once done. Otherwise, set.seed will be used and once done RNGkind will be restored and ".Random.seed" from globalenv set back to its initial value (included removed if it did not exist).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.