tmp <- file.path(tempdir(), "tmplib")
dir.create(tmp)
# install a single package
install_github("cloudyr/ghit", lib = tmp)
# install multiple packages
install_github(c("cloudyr/ghit", "leeper/crandatapkgs"), lib = tmp)
# cleanup
unlink(tmp, recursive = TRUE)
Run the code above in your browser using DataLab