I need to script the install of some R libraries on an offline system. I do possess the source library files I need as I did the install.packages()
from within R on a test system that was online, I saved the downloaded source tar.gz files which included all the dependencies of that library as well.
On the test system that's offline, normally I'd install an R library on the Linux command Linux command line like this, ex:
R CMD INSTALL ggplot2_0.9.3.1.tar.gz
But that only seems to work with packages that have no unmet dependencies. I was hoping by putting all the dependencies in the same folder, it would also install those dependency libraries it needed automatically like install.packages()
does but this is not the case as it complained:
[root@new-host-15 extra]# R CMD INSTALL ggplot2_0.9.3.1.tar.gz
* installing to library ‘/usr/lib64/R/library’
ERROR: dependencies ‘plyr’, ‘digest’, ‘gtable’, ‘reshape2’, ‘scales’, ‘proto’ are not available for package ‘ggplot2’
* removing ‘/usr/lib64/R/library/ggplot2’
My initial thoughts were I would need to install the other dependencies in order with additional R CMD INSTALL
commands but that's a lot of extra commands I would like to avoid if possible. Is there an automatic way to install ggplot2 for example and have all the dependencies which I do have the files for in the same folder also installed automatically without having to specify them individually?