Start me up

December 22, 2016
By

(This article was first published on jottR, and kindly contributed to R-bloggers)

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 .Renviron and .Rprofile startup files, you can split them up into short specific files under corresponding .Renviron.d/ and .Rprofile.d/ directories. For example,

# Environment variables
# (one name=value per line)
.Renviron.d/
+- lang # language settings
+- libs # library settings
+- r_cmd_check # R CMD check settings
+- secrets # secret access keys (don't share!)

# Configuration scripts
# (regular R scripts)
.Rprofile.d/
+- interactive=TRUE/ # Used in interactive-mode only:
| +- help.start.R # - launch the help server on fixed port
| +- misc.R # - TAB completions and more
| +- package=fortunes.R # - show a random fortune (iff installed)
+- package=devtools.R # devtools-specific options
+- os=windows.R # Windows-specific settings
+- repos.R # set up the CRAN repository

All you need to do for this to work is to have a line:

startup::startup()

in your ~/.Rprofile file (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.

Links

To leave a comment for the author, please follow the link and comment on their blog: jottR.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)