How to do a silent install of R

R-bloggers 2014-05-01

(This article was first published on Data science & Software development » R, and kindly contributed to R-bloggers)

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 /SILENTRStudio-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.zippause

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 his blog: Data science & Software development » R.

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