A script for gathering and installing dependency packages for an R project in the case that external http(s) requests cannot be made.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


R Install Dependencies

Build Status

Consider the following situation. You need to install a set of R packages on a machine that cannot make external http(s) requests. As such, you must download source files for the pacakge, along with all of the dependencies, and dependencies of dependencies, etc, and transfer these source files to the machine (likely via FTP) that cannot make the external http(s) requests. Further, you need to install the packages in the correct order so that the install of a dependency does not fail do to a missing dependencies of the the dependency.

The scrpt build-dep-list.R will generate the needed list of dependencies, download the source files, from both CRAN and BioConductor, and then generate a makefile to install the packages in an order so that R package dependencies should not cause errors.


On a computer, with internet access run the following script

Rscript --vanilla build-dep-list.R pkg1 [pkg2] [pkg3] [...] [pkgn]

The R script will download the source (.tar.gz) file for pkg1 and the dependencies (packages listed under Depends, Imports, and LinksTo in the DESCRIPTION file) along with the dependencies of the dependencies, and so on. You may list multiple packages here and the n packages and dependencies will be downloaded.

The source files will be placed in a pkg-source-files directory.

The R script will generate a makefile

After transfering the makefile and the pkg-source-files directory to the remote machine, the user need only to run GNU make the needed packages.