Remove reinitalizeSeed

This function is no longer needed because the minimum R vesion supported by Shiny is 3.0.2.
This commit is contained in:
Winston Chang
2017-06-27 10:30:50 -05:00
parent 65fd1dd2d8
commit fca5b0529a
2 changed files with 1 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
# R's lazy-loading package scheme causes the private seed to be cached in the
# package itself, making our PRNG completely deterministic. This line resets
# the private seed during load.
withPrivateSeed(reinitializeSeed())
withPrivateSeed(set.seed(NULL))
}
.onAttach <- function(libname, pkgname) {

View File

@@ -82,15 +82,6 @@ withPrivateSeed <- function(expr) {
expr
}
# a homemade version of set.seed(NULL) for backward compatibility with R 2.15.x
reinitializeSeed <- if (getRversion() >= '3.0.0') {
function() set.seed(NULL)
} else function() {
if (exists('.Random.seed', globalenv()))
rm(list = '.Random.seed', pos = globalenv())
stats::runif(1) # generate any random numbers so R can reinitialize the seed
}
# Version of runif that runs with private seed
p_runif <- function(...) {
withPrivateSeed(stats::runif(...))