Skip to content
Prev 3871 / 12125 Next

[R-pkg-devel] Change in normal random numbers between R 3.5.3 and R 3.6.0

On 09/05/2019 9:15 a.m., Ulrike Gr?mping wrote:
I am not seeing a difference in rnorm(), but I would expect to see one 
if the new sample() code was used, as it can make a different number of 
calls to the underlying RNG.

That is:  I'd expect this code to give identical results in both 
versions, whether I used val <- 10 or any other value:

val <- 10
set.seed(val)
rnorm(36)

This code does not give identical results, because the calls to sample() 
will result in different changes to the seed:

val <- 10
set.seed(val)
discard <- sample(1000, 100)
rnorm(36)

Duncan Murdoch