How to do a silent install of R
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.
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.
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.
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
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
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
4-3. Run the BAT file as an administrator
These procedures are quite simple and also available when you are upgrading your R environment. Let’s try when you become an R lecturer.
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.