I am using R Version 3.6.1 and would like to set a seed globally for a R session to get the same sequences of random number for all random number generators I call in a script.
A behavior just as described here: setting seed locally (not globally) in R
Currently I would have to call set.seed() in front of every call to a random number generator to get this (see code). Is there a option to set seeds globally?
# Example output
set.seed(2)
runif(1)
[1] 0.1848823
set.seed(2)
runif(1)
[1] 0.1848823
runif(1)
[1] 0.702374
Also, when I looked it up I found alternating behavior.
Here it is described as more global
setting seed locally (not globally) in R
And here it is more local:
set.seed with R 2.15.2
Thanks in advance