The startup package makes it easy to control your R startup processes and to share part of your startup settings with others (e.g. as a public Git repository) while keeping secret parts to yourself. Instead of having long and windy
.Rprofile startup files, you can split them up into short specific files under corresponding
.Rprofile.d/ directories. For example,
# Environment variables<br /># (one name=value per line)<br />.Renviron.d/<br /> +- lang # language settings<br /> +- libs # library settings<br /> +- r_cmd_check # R CMD check settings<br /> +- secrets # secret access keys (don't share!)<br /><br /># Configuration scripts<br /># (regular R scripts)<br />.Rprofile.d/ <br /> +- interactive=TRUE/ # Used in interactive-mode only:<br /> | +- help.start.R # - launch the help server on fixed port<br /> | +- misc.R # - TAB completions and more<br /> | +- package=fortunes.R # - show a random fortune (iff installed)<br /> +- package=devtools.R # devtools-specific options<br /> +- os=windows.R # Windows-specific settings<br /> +- repos.R # set up the CRAN repository<br />All you need to do for this to work is to have a line:
startup::startup()<br />in your
~/.Rprofilefile (you may use it in any of the other locations that R supports). As an alternative to manually edit this file, just call
startup::install()and this line will be appended if missing and if the file is missing that will also be created. Don’t worry, your old file will be backed up with a timestamp.
The startup package is extremely lightweight, has no external dependencies and depends only on the ‘base’ R package. It can be installed from CRAN using
install.packages("startup"). Note, startup 0.4.0 was released on CRAN on 2016-12-22 – until macOS and Windows binaries are available you can install it via
install.packages("startup", type = "source").
For more information on what’s possible to do with the startup package, see the README file of the package.