Install and uninstall support for .Renviron.d and .Rprofile.d startup directories
Source:R/install.R
install.RdInstall and uninstall support for .Renviron.d and .Rprofile.d
startup directories by appending / removing one line of code to the
~/.Rprofile file.
Usage
install(
file = rprofile_user(),
backup = TRUE,
overwrite = FALSE,
path = dirname(file),
make_dirs = TRUE,
quiet = FALSE
)
uninstall(file = rprofile_user(), backup = TRUE, quiet = FALSE)Arguments
- file
The pathname where to create or update the
.Rprofilefile.- backup
If
TRUE, a timestamped backup copy of the original file is created before modifying / overwriting it, otherwise not. If the backup fails, then an error is produced and the R startup file is unmodified.- overwrite
If the R startup file already exist, then
FALSE(default) appends the startup code to the end of the file. is overwritten. IfTRUE, any pre-existing R startup file is overwritten.- path
The folder where to create
.Renviron.dand.Rprofile.ddirectory.- make_dirs
If
TRUE(default), directories.Renviron.d/and.Rprofile.d/are created in folderpath, if missing.- quiet
If
FALSE(default), detailed messages are generated, otherwise not.
Functions
install(): injects atryCatch(startup::startup(), ...)call to the.Rprofilefile, which is created if missing.uninstall(): Remove calls tostartup::startup()and similar.