File tree Expand file tree Collapse file tree 2 files changed +1
-10
lines changed Expand file tree Collapse file tree 2 files changed +1
-10
lines changed Original file line number Diff line number Diff line change 5
5
# R's lazy-loading package scheme causes the private seed to be cached in the
6
6
# package itself, making our PRNG completely deterministic. This line resets
7
7
# the private seed during load.
8
- withPrivateSeed(reinitializeSeed( ))
8
+ withPrivateSeed(set.seed( NULL ))
9
9
}
10
10
11
11
.onAttach <- function (libname , pkgname ) {
Original file line number Diff line number Diff line change @@ -82,15 +82,6 @@ withPrivateSeed <- function(expr) {
82
82
expr
83
83
}
84
84
85
- # a homemade version of set.seed(NULL) for backward compatibility with R 2.15.x
86
- reinitializeSeed <- if (getRversion() > = ' 3.0.0' ) {
87
- function () set.seed(NULL )
88
- } else function () {
89
- if (exists(' .Random.seed' , globalenv()))
90
- rm(list = ' .Random.seed' , pos = globalenv())
91
- stats :: runif(1 ) # generate any random numbers so R can reinitialize the seed
92
- }
93
-
94
85
# Version of runif that runs with private seed
95
86
p_runif <- function (... ) {
96
87
withPrivateSeed(stats :: runif(... ))
You can’t perform that action at this time.
0 commit comments