How to do a silent install of R

[This article was first published on Data science & Software development » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In this post, I’ll introduce how to do a silent install of R. Assume that you are a faculty member at an R course and need to prepare R environments for each students’ PC. In this case, you can install R, RStudio and R package in just one-click by their silent install mode.

1. R silent installation
According to the R FAQ, the R installer has command line options for silent installation “/SILENT” and “/VERYSILENT“. Download the R installer and run the command “R-3.1.0-win.exe /SILENT” from your command prompt enables you to do silent install.

p02

2. RStudio silent installation
RStudio also has silent installation option. This support page describes how to run as a silent mode. According to the page the Rstudio installer has silent option “/S” and the command “RStudio-0.98.507.exe /S” enables you to do a silent install.

p03

3. R package silent installation
R packages such as ggplot2 or plyr are installable from the command line.

3-1. Download the R packages from CRAN site
Download packages and all required/dependent packages(s) mentioned in CRAN page.

p04

3-2. Run a silent installation command
Below is an example of the command.

"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL Rcpp_0.11.1.zip

p07

4. Making a silent installation script
To enable one-click installation, need to create a silent installation script.

4-1. Download installers and R packages and store them into the same folder
p08

4-2. Make a BAT file
Below is a code example, and need to save it as BAT file (ex: Rinstall.bat).

R-3.1.0-win.exe /SILENT
RStudio-0.98.507.exe /S
"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL Rcpp_0.11.1.zip
"%ProgramFiles%\R\R-3.1.0\bin\R" CMD INSTALL plyr_1.8.1.zip
pause

p05

4-3. Run the BAT file as an administrator
p06

These procedures are quite simple and also available when you are upgrading your R environment. Let’s try when you become an R lecturer.


To leave a comment for the author, please follow the link and comment on their blog: Data science & Software development » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)