powered by
This function sets the rng state before running a function. Use with caution. The global environment is changed.
with_rng_state(fun, args, seed)
any
(function) Function to run.
function
(list) Arguments to pass to fun.
list
fun
(integer) RNG state to set before running fun.
integer
with_rng_state(runif, list(n = 1), .Random.seed)
Run the code above in your browser using DataLab