on_start: on_start helper function

View source: R/utils.R

on_startR Documentation

on_start helper function

Description

Internal function, that initializes plotdir, csvdir and logfilename.

Usage

on_start(plotdir, csvdir, logfilename, parallel)

Arguments

plotdir

A character string. Path to the folder, where plots are saved.

csvdir

A character string. Path to the folder, where resulting tables are saved.

logfilename

A character string. Path to a file to save the log messages (default = paste0(tempdir(), "/log.txt")).

parallel

A boolean. If TRUE (the default value), initializing future::plan("multicore") (on unix systems) or future::plan("multisession") (on non-unix systems) before running the code.

Value

This function silently creates the directoriesplotdir and csvdir on the local filesystem and initializes the logfile, specified with logfilename. Furthermore, if parallel = TRUE, the future-backend is initialized.

See Also

plan

Examples

 # runtime > 5 sec.
plotdir <- paste0(tempdir(), "/plots/")
csvdir <- paste0(tempdir(), "/csv/")
logfilename <- paste0(tempdir(), "/log.txt")
parallel <- FALSE

on_start(plotdir, csvdir, logfilename, parallel)



rBiasCorrection documentation built on April 12, 2025, 1:16 a.m.