csdacac csdacac - 1 year ago 129
R Question

Install R packages from Windows CMD

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?


Answer Source

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

Parameter 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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download