Why does RStudio call a random generator while watching?

I am using RStudio 0.99.467 with R 3.2.2 on a Mac, and I noticed that it was Viewcalling a random number generator or something like that. Here are the codes:

set.seed(1) # not needed when I run it on RStudio, but needed on R
rs <- .Random.seed
cat(76 + 8)
all(.Random.seed == rs)
# TRUE  -- because a simple function shouldn't change the random numbers
View(3)
all(.Random.seed == rs)
# FALSE -- ???

Actually, the only difference is the second number .Random.seed

all((.Random.seed == rs)[-2])
# TRUE

which seems to be increasing by 10 units always

.Random.seed[2] - rs[2]
# 10

Is this the expected behavior of the function Viewor is it a bug in the version that I only run?

+4
source share
1 answer

. RStudio 0.99 R sample. 0,98 ( HTML).

, ( , ).

+1

Source: https://habr.com/ru/post/1628424/


All Articles