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
list
package depends onutils
andsandwich
. - The
Rcmdr
package depends ongrDevices
,utils
,splines
,RcmdrMisc
,car
. - The
ggplot2
package 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 CMD
for one package only? Is this the way to install themR CMD INSTALL -l Rcmdr dependencies=TRUE, list dependencies=TRUE, \ ggplot2 dependencies=TRUE, afex, lsmeans
or this incorrect?
- Also, how to I specify the
repos
parameter 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
.