R version 4.4.0 alpha (2024-03-26 r86209 ucrt) 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. > source("incl/start,load-only.R") [15:32:56.162] Detected 'R CMD check': - adjusting defaults to be a good citizen [15:32:56.165] Set package option 'parallelly.availableCores.methods' [15:32:56.165] Environment variable 'R_PARALLELLY_AVAILABLECORES_METHODS' not set [15:32:56.165] Set package option 'parallelly.availableCores.fallback' [15:32:56.166] Environment variable 'R_PARALLELLY_AVAILABLECORES_FALLBACK' not set [15:32:56.166] Set package option 'parallelly.availableCores.min' [15:32:56.166] Environment variable 'R_PARALLELLY_AVAILABLECORES_MIN' not set [15:32:56.167] Set package option 'parallelly.availableCores.system' [15:32:56.167] Environment variable 'R_PARALLELLY_AVAILABLECORES_SYSTEM' not set [15:32:56.168] Set package option 'parallelly.availableCores.logical' [15:32:56.168] Environment variable 'R_PARALLELLY_AVAILABLECORES_LOGICAL' not set [15:32:56.169] Set package option 'parallelly.availableCores.omit' [15:32:56.169] Environment variable 'R_PARALLELLY_AVAILABLECORES_OMIT' not set [15:32:56.170] Set package option 'parallelly.availableWorkers.methods' [15:32:56.170] Environment variable 'R_PARALLELLY_AVAILABLEWORKERS_METHODS' not set [15:32:56.171] Set package option 'parallelly.maxWorkers.localhost' [15:32:56.171] Environment variable 'R_PARALLELLY_MAXWORKERS_LOCALHOST' not set [15:32:56.171] Set package option 'parallelly.maxWorkers.localhost.ignore' [15:32:56.172] Environment variable 'R_PARALLELLY_MAXWORKERS_LOCALHOST_IGNORE' not set [15:32:56.172] Set package option 'parallelly.fork.enable' [15:32:56.173] Environment variable 'R_PARALLELLY_FORK_ENABLE' not set [15:32:56.173] Set package option 'parallelly.supportsMulticore.disableOn' [15:32:56.173] Environment variable 'R_PARALLELLY_SUPPORTSMULTICORE_DISABLEON' not set [15:32:56.174] Set package option 'parallelly.supportsMulticore.unstable' [15:32:56.174] Environment variable 'R_PARALLELLY_SUPPORTSMULTICORE_UNSTABLE' not set [15:32:56.175] Set package option 'parallelly.makeNodePSOCK.setup_strategy' [15:32:56.175] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_SETUP_STRATEGY' not set [15:32:56.176] Set package option 'parallelly.makeNodePSOCK.validate' [15:32:56.176] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_VALIDATE' not set [15:32:56.177] Set package option 'parallelly.makeNodePSOCK.connectTimeout' [15:32:56.177] R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT='120' [15:32:56.177] Coercing from character to numeric: '120' [15:32:56.178] => options("parallelly.makeNodePSOCK.connectTimeout" = '120') [n=1, mode=double] [15:32:56.178] Set package option 'parallelly.makeNodePSOCK.timeout' [15:32:56.179] R_PARALLELLY_MAKENODEPSOCK_TIMEOUT='120' [15:32:56.179] Coercing from character to numeric: '120' [15:32:56.180] => options("parallelly.makeNodePSOCK.timeout" = '120') [n=1, mode=double] [15:32:56.180] Set package option 'parallelly.makeNodePSOCK.useXDR' [15:32:56.181] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_USEXDR' not set [15:32:56.181] Set package option 'parallelly.makeNodePSOCK.socketOptions' [15:32:56.181] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_SOCKETOPTIONS' not set [15:32:56.181] Set package option 'parallelly.makeNodePSOCK.rshcmd' [15:32:56.182] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_RSHCMD' not set [15:32:56.182] Set package option 'parallelly.makeNodePSOCK.rshopts' [15:32:56.182] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_RSHOPTS' not set [15:32:56.183] Set package option 'parallelly.makeNodePSOCK.tries' [15:32:56.183] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_TRIES' not set [15:32:56.183] Set package option 'parallelly.makeNodePSOCK.tries.delay' [15:32:56.183] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_TRIES_DELAY' not set [15:32:56.184] Set package option 'parallelly.makeNodePSOCK.rscript_label' [15:32:56.184] R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL='TRUE' [15:32:56.184] => options("parallelly.makeNodePSOCK.rscript_label" = 'TRUE') [n=1, mode=character] [15:32:56.184] Set package option 'parallelly.makeNodePSOCK.sessionInfo.pkgs' [15:32:56.185] R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS='TRUE' [15:32:56.185] => options("parallelly.makeNodePSOCK.sessionInfo.pkgs" = 'TRUE') [n=1, mode=character] [15:32:56.185] Set package option 'parallelly.makeNodePSOCK.autoKill' [15:32:56.185] R_PARALLELLY_MAKENODEPSOCK_AUTOKILL='TRUE' [15:32:56.186] Coercing from character to logical: 'TRUE' [15:32:56.186] => options("parallelly.makeNodePSOCK.autoKill" = 'TRUE') [n=1, mode=logical] [15:32:56.186] Set package option 'parallelly.makeNodePSOCK.master.localhost.hostname' [15:32:56.186] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_MASTER_LOCALHOST_HOSTNAME' not set [15:32:56.187] Set package option 'parallelly.makeNodePSOCK.port.increment' [15:32:56.187] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_PORT_INCREMENT' not set [15:32:56.189] parallelly-specific environment variables: - R_PARALLELLY_MAKENODEPSOCK_AUTOKILL='TRUE' - R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT='120' - R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL='TRUE' - R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS='TRUE' - R_PARALLELLY_MAKENODEPSOCK_TIMEOUT='120' - R_PARALLELLY_RANDOM_PORTS='20000:39999' [15:32:56.201] Future-specific environment variables: [15:32:56.201] Environment variable 'R_FUTURE_DEMO_MANDELBROT_REGION' not set [15:32:56.201] Environment variable 'R_FUTURE_DEMO_MANDELBROT_NROW' not set [15:32:56.201] Environment variable 'R_FUTURE_DEPRECATED_IGNORE' not set [15:32:56.202] Environment variable 'R_FUTURE_DEPRECATED_DEFUNCT' not set [15:32:56.202] Environment variable 'R_FUTURE_FORK_MULTITHREADING_ENABLE' not set [15:32:56.202] Environment variable 'R_FUTURE_GLOBALS_MAXSIZE' not set [15:32:56.202] Environment variable 'R_FUTURE_GLOBALS_ONMISSING' not set [15:32:56.202] Environment variable 'R_FUTURE_GLOBALS_ONREFERENCE' not set [15:32:56.202] Environment variable 'R_FUTURE_GLOBALS_METHOD' not set [15:32:56.203] Environment variable 'R_FUTURE_GLOBALS_RESOLVE' not set [15:32:56.203] Environment variable 'R_FUTURE_LAZY_ASSERTOWNER' not set [15:32:56.203] Environment variable 'R_FUTURE_PLAN' not set [15:32:56.204] Environment variable 'R_FUTURE_PLAN_DISALLOW' not set [15:32:56.204] Environment variable 'R_FUTURE_PSOCK_RELAY_IMMEDIATE' not set [15:32:56.204] Environment variable 'R_FUTURE_RELAY_IMMEDIATE' not set [15:32:56.204] Environment variable 'R_FUTURE_RESOLVE_RECURSIVE' not set [15:32:56.205] Environment variable 'R_FUTURE_ALIVE_TIMEOUT' not set [15:32:56.205] Environment variable 'R_FUTURE_RESOLVED_TIMEOUT' not set [15:32:56.205] Environment variable 'R_FUTURE_CLUSTER_RESOLVED_TIMEOUT' not set [15:32:56.205] Environment variable 'R_FUTURE_MULTICORE_RESOLVED_TIMEOUT' not set [15:32:56.206] Environment variable 'R_FUTURE_ONFUTURECONDITION_KEEPFUTURE' not set [15:32:56.206] Environment variable 'R_FUTURE_RNG_ONMISUSE' not set [15:32:56.206] Environment variable 'R_FUTURE_GLOBALENV_ONMISUSE' not set [15:32:56.206] Environment variable 'R_FUTURE_WAIT_TIMEOUT' not set [15:32:56.207] Environment variable 'R_FUTURE_WAIT_INTERVAL' not set [15:32:56.207] Environment variable 'R_FUTURE_WAIT_ALPHA' not set [15:32:56.207] Environment variable 'R_FUTURE_ASSIGN_GLOBALS_EXCLUDE' not set [15:32:56.207] Environment variable 'R_FUTURE_OUTPUT_WINDOWS_REENCODE' not set [15:32:56.208] Environment variable 'R_FUTURE_GLOBALS_GLOBALSOF_LOCALS' not set [15:32:56.208] Environment variable 'R_FUTURE_STATE_ONINVALID' not set [15:32:56.208] Environment variable 'R_FUTURE_JOURNAL' not set [15:32:56.209] Environment variable 'R_FUTURE_GLOBALS_KEEPWHERE' not set [15:32:56.210] R process uuid: 58c76f3d-d4e8-543b-a741-5bbd03545d56 [15:32:56.210] Setting plan('default') [15:32:56.211] plan(): Setting new future strategy stack: [15:32:56.211] List of future strategies: [15:32:56.211] 1. sequential: [15:32:56.211] - args: function (..., envir = parent.frame(), workers = "") [15:32:56.211] - tweaked: FALSE [15:32:56.211] - call: NULL [15:32:56.213] plan(): nbrOfWorkers() = 1 [15:32:56.244] plan(): Setting new future strategy stack: [15:32:56.245] List of future strategies: [15:32:56.245] 1. sequential: [15:32:56.245] - args: function (..., envir = parent.frame(), workers = "") [15:32:56.245] - tweaked: FALSE [15:32:56.245] - call: future::plan("sequential") [15:32:56.262] plan(): nbrOfWorkers() = 1 > > message("*** RNG ...") *** RNG ... > > set_random_seed(seed = NULL) Warning in rm(list = ".Random.seed", envir = env, inherits = FALSE) : object '.Random.seed' not found > seed <- get_random_seed() > stopifnot(is.null(seed)) > > set_random_seed(seed = 42L) > seed <- get_random_seed() > stopifnot(identical(seed, 42L)) > > res <- tryCatch({ + seed <- as_lecyer_cmrg_seed(seed = FALSE) + }, error = identity) > print(res) > stopifnot(inherits(res, "error")) > > seed <- as_lecyer_cmrg_seed(seed = 42L) Warning in RNGkind("L'Ecuyer-CMRG") : '.Random.seed[1]' is not a valid RNG kind so ignored > str(seed) int [1:7] 10407 -2133391687 507561766 1260545903 1362917092 -1772566379 -1344458670 > stopifnot(is_lecyer_cmrg_seed(seed)) > set_random_seed(seed = seed) > stopifnot(identical(get_random_seed(), seed)) > > seed2 <- as_lecyer_cmrg_seed(seed = TRUE) > str(seed2) int [1:7] 10407 -2133391687 507561766 1260545903 1362917092 -1772566379 -1344458670 > stopifnot(identical(seed2, seed)) > > seed3 <- as_lecyer_cmrg_seed(seed = seed) > str(seed3) int [1:7] 10407 -2133391687 507561766 1260545903 1362917092 -1772566379 -1344458670 > stopifnot(identical(seed3, seed)) > > ## A random seed > seed4 <- as_lecyer_cmrg_seed(seed = NA) > str(seed4) int [1:7] 10407 1279540750 -941988041 -2007404020 745992093 -1794778694 2071448563 > stopifnot(is_lecyer_cmrg_seed(seed4)) > > > message(" - make_rng_seeds ...") - make_rng_seeds ... > > seeds <- make_rng_seeds(2L, seed = NULL) > stopifnot(is.null(seeds)) > > seeds <- make_rng_seeds(2L, seed = FALSE) > stopifnot(is.null(seeds)) > > seeds <- make_rng_seeds(0L, seed = 42L) [15:32:56.289] Generating random seeds ... [15:32:56.290] Generating random seed streams for 0 elements ... [15:32:56.290] Generating random seed streams for 0 elements ... DONE [15:32:56.290] Generating random seeds ... DONE > stopifnot(length(seeds) == 0L, identical(seeds, list())) > > seeds <- make_rng_seeds(2L, seed = TRUE) [15:32:56.291] Generating random seeds ... [15:32:56.294] Generating random seed streams for 2 elements ... [15:32:56.294] Generating random seed streams for 2 elements ... DONE [15:32:56.295] Generating random seeds ... DONE > stopifnot(length(seeds) == 2L, all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > seeds <- make_rng_seeds(3L, seed = 42L) [15:32:56.295] Generating random seeds ... [15:32:56.296] Generating random seed streams for 3 elements ... [15:32:56.296] Generating random seed streams for 3 elements ... DONE [15:32:56.296] Generating random seeds ... DONE > stopifnot(length(seeds) == 3L, all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > seeds <- make_rng_seeds(1L, seed = 42L) [15:32:56.297] Generating random seeds ... [15:32:56.297] Generating random seed streams for 1 elements ... [15:32:56.297] Generating random seed streams for 1 elements ... DONE [15:32:56.298] Generating random seeds ... DONE > stopifnot(length(seeds) == 1L, all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > seeds0 <- lapply(1:3, FUN = as_lecyer_cmrg_seed) > seeds <- make_rng_seeds(length(seeds0), seed = seeds0) [15:32:56.298] Generating random seeds ... [15:32:56.298] Using a pre-define stream of 3 random seeds ... [15:32:56.299] Using a pre-define stream of 3 random seeds ... DONE [15:32:56.299] Generating random seeds ... DONE > stopifnot(length(seeds) == length(seeds0), + all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > > message(" - exceptions ...") - exceptions ... > > ## Invalid L'Ecuyer seed > seed_invalid <- seed + 1L > res <- tryCatch({ + seed <- as_lecyer_cmrg_seed(seed = seed_invalid) + }, error = identity) > print(res) > stopifnot(inherits(res, "error")) > > ## Invalid seed > res <- tryCatch({ + seed <- as_lecyer_cmrg_seed(seed = 1:2) + }, error = identity) > print(res) > stopifnot(inherits(res, "error")) > > ## Invalid length > seeds0 <- lapply(1:2, FUN = as_lecyer_cmrg_seed) > res <- tryCatch({ + seeds <- make_rng_seeds(1L, seed = seeds0) + }, error = identity) [15:32:56.302] Generating random seeds ... [15:32:56.302] Using a pre-define stream of 1 random seeds ... > print(res) > stopifnot(inherits(res, "error")) > > ## Seeds of different kinds > seeds0 <- lapply(1:2, FUN = as_lecyer_cmrg_seed) > seeds0[[1]] <- seeds0[[1]][-1] > res <- tryCatch({ + seeds <- make_rng_seeds(2L, seed = seeds0) + }, error = identity) [15:32:56.303] Generating random seeds ... [15:32:56.303] Using a pre-define stream of 2 random seeds ... > print(res) > stopifnot(inherits(res, "error")) > > ## List of scalar seeds? > res <- tryCatch({ + seeds <- make_rng_seeds(1L, seed = list(42L)) + }, error = identity) [15:32:56.304] Generating random seeds ... [15:32:56.305] Using a pre-define stream of 1 random seeds ... > print(res) > stopifnot(inherits(res, "error")) > > ## Not seeds at all? > seeds0 <- lapply(1:2, FUN = as_lecyer_cmrg_seed) > seeds0[[1]] <- letters[1:7] > res <- tryCatch({ + seeds <- make_rng_seeds(2L, seed = seeds0) + }, error = identity) [15:32:56.306] Generating random seeds ... [15:32:56.306] Using a pre-define stream of 2 random seeds ... > print(res) > stopifnot(inherits(res, "error")) > > ## Invalid seeds? > seeds0 <- lapply(1:2, FUN = as_lecyer_cmrg_seed) > seeds0 <- lapply(seeds0, FUN = rev) > res <- tryCatch({ + seeds <- make_rng_seeds(2L, seed = seeds0) + }, error = identity) [15:32:56.307] Generating random seeds ... [15:32:56.307] Using a pre-define stream of 2 random seeds ... > print(res) > stopifnot(inherits(res, "error")) > > > message(" - replicated RNG draws") - replicated RNG draws > library(future.apply) Loading required package: future [15:32:56.322] Option 'future.startup.script': TRUE [15:32:56.322] Future startup scripts considered: '.future.R', '~/.future.R' [15:32:56.323] Future startup scripts found: > > seed_org <- next_random_seed() > set.seed(42) > > ## Draw two random number from 1:100 one after the other > seed_before <- get_random_seed() > kind_before <- RNGkind() > x <- sample.int(100L, size = 5L) > y <- sample.int(100L, size = 5L) > seed_after <- get_random_seed() > kind_after <- RNGkind() > print(c(x, y)) [1] 2 4 63 76 97 9 85 10 66 23 > > ## Draw two random number from 1:100 at once > set_random_seed(seed_before) > kind_before2 <- RNGkind() > z <- sample.int(100L, size = 10L) > seed_after2 <- get_random_seed() > kind_after2 <- RNGkind() > print(z) [1] 2 4 63 76 97 9 85 10 66 23 > > ## The RNG state is the same after the second ... > ## run as after the first, two-step, approach > stopifnot(identical(seed_after2, seed_after)) > stopifnot(identical(kind_before2, kind_before)) > stopifnot(identical(kind_after2, kind_after)) > > ## .... and the exact same set of random numbers where > ## drawn [only true in R (>= 4.0.0)] > if (getRversion() >= "4.0.0") { + stopifnot(identical(z, c(x, y))) + } else { + stopifnot(identical(z[seq_along(x)], x)) + } > > set_random_seed(seed_org) > stopifnot(identical(get_random_seed(), seed_org)) > > message("*** RNG ... DONE") *** RNG ... DONE > > source("incl/end.R") [15:32:56.329] plan(): Setting new future strategy stack: [15:32:56.329] List of future strategies: [15:32:56.329] 1. FutureStrategy: [15:32:56.329] - args: function (..., envir = parent.frame(), workers = "") [15:32:56.329] - tweaked: FALSE [15:32:56.329] - call: future::plan(oplan) [15:32:56.354] plan(): nbrOfWorkers() = 1 > > proc.time() user system elapsed 0.43 0.15 0.53