Skip to content

Commit fca5b05

Browse files
committed
Remove reinitalizeSeed
This function is no longer needed because the minimum R vesion supported by Shiny is 3.0.2.
1 parent 65fd1dd commit fca5b05

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

R/globals.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# R's lazy-loading package scheme causes the private seed to be cached in the
66
# package itself, making our PRNG completely deterministic. This line resets
77
# the private seed during load.
8-
withPrivateSeed(reinitializeSeed())
8+
withPrivateSeed(set.seed(NULL))
99
}
1010

1111
.onAttach <- function(libname, pkgname) {

R/utils.R

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,6 @@ withPrivateSeed <- function(expr) {
8282
expr
8383
}
8484

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-
9485
# Version of runif that runs with private seed
9586
p_runif <- function(...) {
9687
withPrivateSeed(stats::runif(...))

0 commit comments

Comments
 (0)