mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-03 11:15:07 -05:00
- Introduce randomInt/p_randomInt to generate random integers in a half-open range - Stop using runif to generate integers - Explicitly reset the private seed during .onLoad. I was getting the same "random" numbers from Shiny every time I restarted R!
10 lines
359 B
R
10 lines
359 B
R
# A scope where we can put mutable global state
|
|
.globals <- new.env(parent = emptyenv())
|
|
|
|
.onLoad <- function(libname, pkgname) {
|
|
# 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(set.seed(NULL))
|
|
}
|