I'm trying to install two R packages from the Windows CMD. I've looked around and I can't find a completely automatic way of achieving this.
Does anyone have any ideas?
For me it works using rscript.exe. Similar to Install binary zipped R package via command line, but that one is for a local file.
Example of getting 'igraph' package:
C:\Program Files\R\R-3.1.1\bin>RScript.exe -e "install.packages('igraph', repos ='http://cran.rstudio.com/')"
repos has to be provided, otherwise you get error
Error in contrib.url(repos, "source") : trying to use CRAN without setting a mirror Calls: install.packages -> contrib.url Execution halted
Pick a mirror you like - http://cran.r-project.org/mirrors.html