Below are environment variables and R options that are used by the
startup package.
The R_STARTUP_***
environment variables must be set before calling
the startup::startup()
function, that is, either (i) prior to launching
R or (ii) in the .Renviron
file.
R_STARTUP_DISABLE
/ startup.disable:(logical)
If TRUE
, startup::startup()
is fully disable such that no
.Renviron.d/
or .Rprofile.d/
files are processed.
Note: Files .Renviron
and .Rprofile
are still processed
because these are out of control of the startup package.
(Default: FALSE
)
R_STARTUP_DRYRUN
/ startup.dryrun:(logical)
Controls the default value of argument dryrun
of startup()
.
(Default: FALSE
)
R_STARTUP_FILE
/ startup.file:(R script as a character string)
Optional R script that is parsed and evaluated after
.Renviron.d/
and .Rprofile.d/
files,
and R_STARTUP_INIT
code, have been processed, e.g.
R_STARTUP_FILE="setup.R" R --quiet
.
(Default: not specified)
R_STARTUP_INIT
/ startup.init:(R code as a character string)
Optional R code that is parsed and evaluated after
.Renviron.d/
and .Rprofile.d/
files,
but before R_STARTUP_FILE
code, have been processed e.g.
R_STARTUP_INIT="message('Hello world')" R --quiet
.
The specified string must be parsable by base::parse()
.
(Default: not specified)
R_STARTUP_RDATA
/ startup.rdata:(comma-separated values)
Controls whether an existing ./.RData
file should be processed
or not.
If "remove"
, it will be skipped by automatically removing it.
If "rename"
, it will be renamed to ./.RData.YYYYMMDD_hhmmss
where the timestamp is the last time the file was modified.
If "prompt"
, the user is prompted whether they want to load the file
or rename it. In non-interactive session, "prompt"
will fallback to
loading the content (default). To fallback to renaming the file, use
"prompt,rename"
.
If "warn"
, a warning will be produced, but content is still loaded.
Note that in contrast to R
and R CMD BATCH file.R
, Rscript
does
not load .RData
files unless command-line option --restore
is specified.
(Default: not specified)
R_STARTUP_CHECK
/ startup.check:(logical)
Controls the default value of argument check
of startup()
.
(Default: TRUE
)
R_STARTUP_CHECK_OPTIONS_IGNORE
/
startup.check.options.ignore:(character vector or comma-separated character string)
Names of R options that should not be validated at the end of the
startup()
process.
(Default: "error"
)
R_STARTUP_DEBUG
/ startup.debug:(logical)
Controls the default value of argument debug
of startup()
.
(Default: FALSE
)
R_STARTUP_DEBUG_FILE
/ startup.debug.file:(character string or NULL)
Controls where startup()
debug messages are outputted.
If set, it specifies the file where debug messages are written to.
If file already exists, it is overwritten.
Unless an absolute filename is given, the location of the file is
relative to the working directory where R was started.
If the filename comprise the string {{pid}}
, it is replaced by
the R process' process identifier (PID) per Sys.getpid()
.
If NULL
or <message>
, then debug is outputted using the
message()
function.
(Default: not specified)
(character vector)
Overrides the command-line arguments that startup()
uses, which
can be useful to prototype and test alternative ways that R might
be launched.
(Default: base::commandArgs()
)
R_STARTUP_TIME
/ startup.time:(POSIX timestamp; character string)
Overrides the current timestamp, which can be useful to prototype and
test functionalities that depend on the current time, e.g. inclusion
and exclusion of files based on when=<periodicity>
tags.
The specified string must be parsable by base::as.POSIXct()
.
(Default: not specified)