startup_files: Files Related to Initialization of the R Session

startup_filesR Documentation

Files Related to Initialization of the R Session

Description

site.file() and init.file() return the \codelink2base:normalizePathnormalized paths of the site-wide startup profile file and the user profile that were run at \codelink2base:Startupstartup.

with_init.file() declares that the current script is the user profile then evaluates and auto-prints the sub-expressions of its argument.

Usage

site.file(original = FALSE, for.msg = FALSE, default, else.)
init.file(original = FALSE, for.msg = FALSE, default, else.)

with_site.file(expr)
with_init.file(expr)

Arguments

original, for.msg, default, else.

Same as shFILE().

expr

a braced expression, the sub-expressions of which to evaluate and auto-print.

Value

for site.file() and init.file(), a character string, or default if it was not found.

for with_site.file() and with_init.file(), NULL invisibly.

Note

with_site.file() is unneeded now that the site-wide startup profile file can be automatically detected.

Examples

## if you wish to use this.path() in a user profile,
## instead of writing:
##
## <expr 1>
## <expr 2>
## <...>
##
## write this:
##
## @R_PACKAGE_NAME@::with_init.file({
## <expr 1>
## <expr 2>
## <...>
## })

ArcadeAntics/this.path documentation built on July 27, 2024, 12:05 a.m.