I have to perform a remote R installation on an Ubuntu 16.10 system. As part of this, I have to install specific packages on that host. I want to install these packages Rcmdr,list,ggplot2,afex,lsmeans. Since I am doing this remotely, I cannot use
sudo -i R
to first enter the R CLI and then install with install.packages(). Instead I must somehow install the packages from the Ubuntu CLI.
I found these links:
- multiple R package installation with install.packages()
- R CMD INSTALL -l usage syntax to install multiple packages in section 6.3
- Use of repos parameter inside install.packages()
However, some packages have dependencies:
- The
listpackage depends onutilsandsandwich. - The
Rcmdrpackage depends ongrDevices,utils,splines,RcmdrMisc,car. - The
ggplot2package also has dependencies.
I would like to install only the packages Rcmdr,list,ggplot2 with all their dependencies. Normally, I would do it this way:
install.packages(c('Rcmdr','list','ggplot2'), dependencies=TRUE)
QUESTIONS
How do I specify the dependencies option in
R CMDfor one package only? Is this the way to install themR CMD INSTALL -l Rcmdr dependencies=TRUE, list dependencies=TRUE, \ ggplot2 dependencies=TRUE, afex, lsmeansor this incorrect?
- Also, how to I specify the
reposparameter insideR CMD INSTALL -l?
EDIT
As per the first comment below, sudo is not needed above.i.e. sudo -i R can be replaced by R.