R Under development (unstable) (2024-10-26 r87273 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. > source("incl/start,load-only.R") [18:42:08.500] Detected 'R CMD check': - adjusting defaults to be a good citizen [18:42:08.502] Set package option 'parallelly.availableCores.methods' [18:42:08.503] Environment variable 'R_PARALLELLY_AVAILABLECORES_METHODS' not set [18:42:08.503] Set package option 'parallelly.availableCores.fallback' [18:42:08.503] Environment variable 'R_PARALLELLY_AVAILABLECORES_FALLBACK' not set [18:42:08.504] Set package option 'parallelly.availableCores.min' [18:42:08.504] Environment variable 'R_PARALLELLY_AVAILABLECORES_MIN' not set [18:42:08.504] Set package option 'parallelly.availableCores.system' [18:42:08.504] Environment variable 'R_PARALLELLY_AVAILABLECORES_SYSTEM' not set [18:42:08.505] Set package option 'parallelly.availableCores.logical' [18:42:08.505] Environment variable 'R_PARALLELLY_AVAILABLECORES_LOGICAL' not set [18:42:08.505] Set package option 'parallelly.availableCores.omit' [18:42:08.506] Environment variable 'R_PARALLELLY_AVAILABLECORES_OMIT' not set [18:42:08.506] Set package option 'parallelly.availableWorkers.methods' [18:42:08.506] Environment variable 'R_PARALLELLY_AVAILABLEWORKERS_METHODS' not set [18:42:08.506] Set package option 'parallelly.maxWorkers.localhost' [18:42:08.507] Environment variable 'R_PARALLELLY_MAXWORKERS_LOCALHOST' not set [18:42:08.507] Set package option 'parallelly.maxWorkers.localhost.ignore' [18:42:08.507] Environment variable 'R_PARALLELLY_MAXWORKERS_LOCALHOST_IGNORE' not set [18:42:08.507] Set package option 'parallelly.fork.enable' [18:42:08.508] Environment variable 'R_PARALLELLY_FORK_ENABLE' not set [18:42:08.508] Set package option 'parallelly.supportsMulticore.disableOn' [18:42:08.508] Environment variable 'R_PARALLELLY_SUPPORTSMULTICORE_DISABLEON' not set [18:42:08.508] Set package option 'parallelly.supportsMulticore.unstable' [18:42:08.509] Environment variable 'R_PARALLELLY_SUPPORTSMULTICORE_UNSTABLE' not set [18:42:08.509] Set package option 'parallelly.makeNodePSOCK.setup_strategy' [18:42:08.509] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_SETUP_STRATEGY' not set [18:42:08.510] Set package option 'parallelly.makeNodePSOCK.validate' [18:42:08.510] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_VALIDATE' not set [18:42:08.510] Set package option 'parallelly.makeNodePSOCK.connectTimeout' [18:42:08.510] R_PARALLELLY_MAKENODEPSOCK_CONNECTTIMEOUT='120' [18:42:08.511] Coercing from character to numeric: '120' [18:42:08.511] => options("parallelly.makeNodePSOCK.connectTimeout" = '120') [n=1, mode=double] [18:42:08.511] Set package option 'parallelly.makeNodePSOCK.timeout' [18:42:08.511] R_PARALLELLY_MAKENODEPSOCK_TIMEOUT='120' [18:42:08.512] Coercing from character to numeric: '120' [18:42:08.512] => options("parallelly.makeNodePSOCK.timeout" = '120') [n=1, mode=double] [18:42:08.512] Set package option 'parallelly.makeNodePSOCK.useXDR' [18:42:08.512] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_USEXDR' not set [18:42:08.513] Set package option 'parallelly.makeNodePSOCK.socketOptions' [18:42:08.513] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_SOCKETOPTIONS' not set [18:42:08.513] Set package option 'parallelly.makeNodePSOCK.rshcmd' [18:42:08.514] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_RSHCMD' not set [18:42:08.514] Set package option 'parallelly.makeNodePSOCK.rshopts' [18:42:08.514] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_RSHOPTS' not set [18:42:08.514] Set package option 'parallelly.makeNodePSOCK.tries' [18:42:08.515] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_TRIES' not set [18:42:08.515] Set package option 'parallelly.makeNodePSOCK.tries.delay' [18:42:08.515] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_TRIES_DELAY' not set [18:42:08.515] Set package option 'parallelly.makeNodePSOCK.rscript_label' [18:42:08.516] R_PARALLELLY_MAKENODEPSOCK_RSCRIPT_LABEL='TRUE' [18:42:08.516] => options("parallelly.makeNodePSOCK.rscript_label" = 'TRUE') [n=1, mode=character] [18:42:08.516] Set package option 'parallelly.makeNodePSOCK.sessionInfo.pkgs' [18:42:08.516] R_PARALLELLY_MAKENODEPSOCK_SESSIONINFO_PKGS='TRUE' [18:42:08.517] => options("parallelly.makeNodePSOCK.sessionInfo.pkgs" = 'TRUE') [n=1, mode=character] [18:42:08.517] Set package option 'parallelly.makeNodePSOCK.autoKill' [18:42:08.517] R_PARALLELLY_MAKENODEPSOCK_AUTOKILL='TRUE' [18:42:08.517] Coercing from character to logical: 'TRUE' [18:42:08.518] => options("parallelly.makeNodePSOCK.autoKill" = 'TRUE') [n=1, mode=logical] [18:42:08.518] Set package option 'parallelly.makeNodePSOCK.master.localhost.hostname' [18:42:08.518] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_MASTER_LOCALHOST_HOSTNAME' not set [18:42:08.518] Set package option 'parallelly.makeNodePSOCK.port.increment' [18:42:08.519] Environment variable 'R_PARALLELLY_MAKENODEPSOCK_PORT_INCREMENT' not set [18:42:08.520] 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' [18:42:08.529] Future-specific environment variables: [18:42:08.529] Environment variable 'R_FUTURE_DEMO_MANDELBROT_REGION' not set [18:42:08.529] Environment variable 'R_FUTURE_DEMO_MANDELBROT_NROW' not set [18:42:08.530] Environment variable 'R_FUTURE_DEPRECATED_IGNORE' not set [18:42:08.530] Environment variable 'R_FUTURE_DEPRECATED_DEFUNCT' not set [18:42:08.530] Environment variable 'R_FUTURE_FORK_MULTITHREADING_ENABLE' not set [18:42:08.530] Environment variable 'R_FUTURE_GLOBALS_MAXSIZE' not set [18:42:08.530] Environment variable 'R_FUTURE_GLOBALS_ONMISSING' not set [18:42:08.531] Environment variable 'R_FUTURE_GLOBALS_ONREFERENCE' not set [18:42:08.531] Environment variable 'R_FUTURE_GLOBALS_METHOD' not set [18:42:08.531] Environment variable 'R_FUTURE_GLOBALS_RESOLVE' not set [18:42:08.531] Environment variable 'R_FUTURE_LAZY_ASSERTOWNER' not set [18:42:08.531] Environment variable 'R_FUTURE_PLAN' not set [18:42:08.531] Environment variable 'R_FUTURE_PLAN_DISALLOW' not set [18:42:08.532] Environment variable 'R_FUTURE_PSOCK_RELAY_IMMEDIATE' not set [18:42:08.532] Environment variable 'R_FUTURE_RELAY_IMMEDIATE' not set [18:42:08.532] Environment variable 'R_FUTURE_RESOLVE_RECURSIVE' not set [18:42:08.532] Environment variable 'R_FUTURE_ALIVE_TIMEOUT' not set [18:42:08.532] Environment variable 'R_FUTURE_RESOLVED_TIMEOUT' not set [18:42:08.533] Environment variable 'R_FUTURE_CLUSTER_RESOLVED_TIMEOUT' not set [18:42:08.533] Environment variable 'R_FUTURE_MULTICORE_RESOLVED_TIMEOUT' not set [18:42:08.533] Environment variable 'R_FUTURE_ONFUTURECONDITION_KEEPFUTURE' not set [18:42:08.533] Environment variable 'R_FUTURE_RNG_ONMISUSE' not set [18:42:08.533] Environment variable 'R_FUTURE_GLOBALENV_ONMISUSE' not set [18:42:08.533] Environment variable 'R_FUTURE_WAIT_TIMEOUT' not set [18:42:08.534] Environment variable 'R_FUTURE_WAIT_INTERVAL' not set [18:42:08.534] Environment variable 'R_FUTURE_WAIT_ALPHA' not set [18:42:08.534] Environment variable 'R_FUTURE_ASSIGN_GLOBALS_EXCLUDE' not set [18:42:08.534] Environment variable 'R_FUTURE_OUTPUT_WINDOWS_REENCODE' not set [18:42:08.534] Environment variable 'R_FUTURE_GLOBALS_GLOBALSOF_LOCALS' not set [18:42:08.535] Environment variable 'R_FUTURE_STATE_ONINVALID' not set [18:42:08.535] Environment variable 'R_FUTURE_JOURNAL' not set [18:42:08.535] Environment variable 'R_FUTURE_GLOBALS_KEEPWHERE' not set [18:42:08.535] Environment variable 'R_FUTURE_GLOBALS_OBJECTSIZE_METHOD' not set [18:42:08.535] Environment variable 'R_FUTURE_PLAN_CLEANUP_LEGACY' not set [18:42:08.536] R process uuid: cb9a628e-e1fc-f71d-cf8c-a1dfc862e7c6 [18:42:08.537] Setting plan('default') [18:42:08.537] plan(): Setting new future strategy stack: [18:42:08.538] List of future strategies: [18:42:08.538] 1. sequential: [18:42:08.538] - args: function (..., envir = parent.frame(), workers = "") [18:42:08.538] - tweaked: FALSE [18:42:08.538] - call: NULL [18:42:08.539] plan(): nbrOfWorkers() = 1 [18:42:08.565] plan(): Setting new future strategy stack: [18:42:08.565] List of future strategies: [18:42:08.565] 1. sequential: [18:42:08.565] - args: function (..., envir = parent.frame(), workers = "") [18:42:08.565] - tweaked: FALSE [18:42:08.565] - call: future::plan("sequential") [18:42:08.576] 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) [18:42:08.594] Generating random seeds ... [18:42:08.595] Generating random seed streams for 0 elements ... [18:42:08.595] Generating random seed streams for 0 elements ... DONE [18:42:08.595] Generating random seeds ... DONE > stopifnot(length(seeds) == 0L, identical(seeds, list())) > > seeds <- make_rng_seeds(2L, seed = TRUE) [18:42:08.595] Generating random seeds ... [18:42:08.595] Generating random seed streams for 2 elements ... [18:42:08.596] Generating random seed streams for 2 elements ... DONE [18:42:08.596] Generating random seeds ... DONE > stopifnot(length(seeds) == 2L, all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > seeds <- make_rng_seeds(3L, seed = 42L) [18:42:08.596] Generating random seeds ... [18:42:08.596] Generating random seed streams for 3 elements ... [18:42:08.596] Generating random seed streams for 3 elements ... DONE [18:42:08.597] Generating random seeds ... DONE > stopifnot(length(seeds) == 3L, all(sapply(seeds, FUN = is_lecyer_cmrg_seed))) > > seeds <- make_rng_seeds(1L, seed = 42L) [18:42:08.597] Generating random seeds ... [18:42:08.597] Generating random seed streams for 1 elements ... [18:42:08.597] Generating random seed streams for 1 elements ... DONE [18:42:08.597] 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) [18:42:08.598] Generating random seeds ... [18:42:08.598] Using a pre-define stream of 3 random seeds ... [18:42:08.598] Using a pre-define stream of 3 random seeds ... DONE [18:42:08.598] 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) [18:42:08.600] Generating random seeds ... [18:42:08.600] 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) [18:42:08.601] Generating random seeds ... [18:42:08.601] 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) [18:42:08.601] Generating random seeds ... [18:42:08.602] 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) [18:42:08.602] Generating random seeds ... [18:42:08.602] 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) [18:42:08.603] Generating random seeds ... [18:42:08.603] 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 [18:42:08.611] Option 'future.startup.script': TRUE [18:42:08.612] Future startup scripts considered: '.future.R', '~/.future.R' [18:42:08.612] 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") [18:42:08.616] plan(): Setting new future strategy stack: [18:42:08.616] List of future strategies: [18:42:08.616] 1. FutureStrategy: [18:42:08.616] - args: function (..., envir = parent.frame(), workers = "") [18:42:08.616] - tweaked: FALSE [18:42:08.616] - call: future::plan(oplan) [18:42:08.630] plan(): nbrOfWorkers() = 1 > > proc.time() user system elapsed 0.31 0.06 0.37