R Under development (unstable) (2025-06-05 r88281 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 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.R") Loading required package: parallelly Loading required package: future > > message("*** Utility functions ...") *** Utility functions ... > > message("- is_na() ...") - is_na() ... > stopifnot(is_na(NA), !is_na(TRUE), !is_na(FALSE), !is_na(1), + !is_na(NULL), !is_na(1:2), !is_na(rep(NA, times = 3)), + !is_na(rep(TRUE, 3)), !is_na(letters)) > > message("- is_false() ...") - is_false() ... > stopifnot(is_false(FALSE), !is_false(TRUE), !is_false(NA), !is_false(1), + !is_false(NULL), !is_false(1:2), !is_false(rep(FALSE, times = 3)), + !is_false(rep(TRUE, times = 3)), !is_false(letters)) > > message("- attached_packages() ...") - attached_packages() ... > print(attached_packages()) [1] "future.batchtools" "future" "parallelly" [4] "stats" "graphics" "grDevices" [7] "utils" "datasets" "methods" [10] "base" > > > message("- hpaste() & printf() ...") - hpaste() & printf() ... > # Some vectors > x <- 1:6 > y <- 10:1 > z <- LETTERS[x] > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # Abbreviation of output vector > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > printf("x = %s.\n", hpaste(x)) x = 1, 2, 3, ..., 6. > ## x = 1, 2, 3, ..., 6. > > printf("x = %s.\n", hpaste(x, max_head = 2)) x = 1, 2, ..., 6. > ## x = 1, 2, ..., 6. > > printf("x = %s.\n", hpaste(x, max_head = 3)) # Default x = 1, 2, 3, ..., 6. > ## x = 1, 2, 3, ..., 6. > > # It will never output 1, 2, 3, 4, ..., 6 > printf("x = %s.\n", hpaste(x, max_head = 4)) x = 1, 2, 3, 4, 5, 6. > ## x = 1, 2, 3, 4, 5 and 6. > > # Showing the tail > printf("x = %s.\n", hpaste(x, max_head = 1, max_tail = 2)) x = 1, ..., 5, 6. > ## x = 1, ..., 5, 6. > > # Turning off abbreviation > printf("y = %s.\n", hpaste(y, max_head = Inf)) y = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1. > ## y = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 > > ## ...or simply > printf("y = %s.\n", paste(y, collapse = ", ")) y = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1. > ## y = 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 > > # Adding a special separator before the last element > # Change last separator > printf("x = %s.\n", hpaste(x, last_collapse = " and ")) x = 1, 2, 3, 4, 5 and 6. > ## x = 1, 2, 3, 4, 5 and 6. > > message("- mcat(), mprintf(), mprint() and mstr() ...") - mcat(), mprintf(), mprint() and mstr() ... > mcat("Hello world!\n") Hello world! > mprintf("Hello %s!\n", "world") Hello world! > mprint("Hello world!") [04:39:59.803] [1] "Hello world!" > mstr("Hello world!") [04:39:59.805] chr "Hello world!" > > message("- trim() ...") - trim() ... > mprint(trim(" hello ")) [04:39:59.809] [1] "hello" > stopifnot(trim(" hello ") == "hello") > > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # is_os() > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > message("- is_os() ...") - is_os() ... > for (os in c("darwin", "freebsd", "irix", "linux", "openbsd", + "solaris", "windows")) { + mprintf("is_os('%s') = %s", os, is_os(os)) + } is_os('darwin') = FALSEis_os('freebsd') = FALSEis_os('irix') = FALSEis_os('linux') = FALSEis_os('openbsd') = FALSEis_os('solaris') = FALSEis_os('windows') = TRUE> > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > # import_future() > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > message("*** import_future() ...") *** import_future() ... > > future <- import_future("future") > stopifnot(identical(future, future::future)) > > future <- import_future("", default = future::future) > stopifnot(identical(future, future::future)) > > res <- try(import_future(""), silent = TRUE) > stopifnot(inherits(res, "try-error")) > > message("*** import_future() ... DONE") *** import_future() ... DONE > > message("*** Utility functions ... DONE") *** Utility functions ... DONE > > source("incl/end.R") > > proc.time() user system elapsed 0.87 0.31 1.12