Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Last active August 29, 2015 14:03
Show Gist options
  • Save nassimhaddad/c5eadfcc6fb774d77601 to your computer and use it in GitHub Desktop.
Save nassimhaddad/c5eadfcc6fb774d77601 to your computer and use it in GitHub Desktop.
download dependent packages. useful to create a production environment, manage versions, and working on machines with no internet connections.
# Install https://github.com/andrie/miniCRAN
require(tools)
require(miniCRAN)
repositorylocation <- "/home/Downloads"
pks <- package_dependencies(c("data.table","ffbase"), db = available.packages(),
which = c("Depends","Imports","LinkingTo"), recursive=TRUE)
pks <- unique(c(do.call(c, pks), c("data.table","ffbase")))
makeRepo(pkgs=pks, path=repositorylocation, type = "source", download = TRUE, writePACKAGES = TRUE)
install.packages(pkgs = "data.table", repos = repositorylocation, type = "source",
available=pkgAvail(repositorylocation))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment