R Under development (unstable) (2024-10-17 r87242 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(randtoolbox) Loading required package: rngWELL This is randtoolbox. For an overview, type 'help("randtoolbox")'. > > try( randtoolbox:::.getrandtoolboxEnv(".torus.seed") ) Error in get(x, envir = .randtoolboxEnv, mode = "any") : object '.torus.seed' not found > !exists(".torus.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] TRUE > try( torus(1, init=FALSE) ) Error in torus(1, init = FALSE) : Torus algorithm not initialized. > try( randtoolbox:::.getrandtoolboxEnv(".torus.seed") ) Error in get(x, envir = .randtoolboxEnv, mode = "any") : object '.torus.seed' not found > > > torus(1, init=TRUE) [1] 0.4142136 > randtoolbox:::.getrandtoolboxEnv(".torus.seed") $offset [1] 2 > !exists(".torus.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] FALSE > > torus(1, init=FALSE) [1] 0.8284271 > randtoolbox:::.getrandtoolboxEnv(".torus.seed") $offset [1] 3 > !exists(".torus.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] FALSE > > torus(1, init=FALSE) [1] 0.2426407 > randtoolbox:::.getrandtoolboxEnv(".torus.seed") $offset [1] 4 > !exists(".torus.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] FALSE > > > > > try( randtoolbox:::.getrandtoolboxEnv(".halton.seed") ) #not found Error in get(x, envir = .randtoolboxEnv, mode = "any") : object '.halton.seed' not found > !exists(".halton.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] TRUE > try( halton(1, init=FALSE) ) Error in halton(1, init = FALSE) : Halton algorithm not initialized. > > try( randtoolbox:::.getrandtoolboxEnv(".halton.seed") ) Error in get(x, envir = .randtoolboxEnv, mode = "any") : object '.halton.seed' not found > halton(7, init=TRUE) [1] 0.500 0.250 0.750 0.125 0.625 0.375 0.875 > randtoolbox:::.getrandtoolboxEnv(".halton.seed") #now initialized $base [1] 2 $offset [1] 8 > !exists(".halton.seed", envir=randtoolbox:::.randtoolboxEnv, mode="list") [1] FALSE > > halton(1, init=FALSE) [1] 0.0625 > randtoolbox:::.getrandtoolboxEnv(".halton.seed") #now initialized $base [1] 2 $offset [1] 9 > halton(1, init=TRUE) [1] 0.5 > randtoolbox:::.getrandtoolboxEnv(".halton.seed") #reset $base [1] 2 $offset [1] 2 > halton(6, init=FALSE) [1] 0.250 0.750 0.125 0.625 0.375 0.875 > randtoolbox:::.getrandtoolboxEnv(".halton.seed") $base [1] 2 $offset [1] 8 > halton(1, init=FALSE) [1] 0.0625 > > > proc.time() user system elapsed 0.20 0.09 0.28