install_github allows users to install R packages hosted on GitHub without needing to install or load the heavy dependencies required by devtools. ghit provides a drop-in replacement that provides (almost) identical functionality to
install_github(repo, host = "github.com", credentials = NULL, build_args = NULL, build_vignettes = TRUE, uninstall = FALSE, verbose = FALSE, repos = NULL, type = "source", dependencies = NA, ...)
A character vector naming one or more GitHub repository containing an R package to install (e.g., “leeper/ghit”), or optionally a branch (“leeper/ghit[dev]”), a reference (“leeper/ghit@b200fb1bd”), tag (“email@example.com”), or subdirectory (“leeper/ghit/R”). These arguments can be placed in any order and in any combination (e.g., “leeper/ghit[master]@abc123/R”).
A character string naming a host, to enable installation of enterprise-hosted GitHub packages.
A character string used to control the package build, passed to
R CMD build.
A logical specifying whether to build package vignettes, passed to
R CMD build. Can be slow. Note: The default is
TRUE, unlike in
A logical specifying whether to uninstall previous installations using
remove.packages before attempting install. This is useful for installing an older version of a package than the one currently installed.
A logical specifying whether to print details of package building and installation.
A character vector specifying one or more URLs for CRAN-like repositories from which package dependencies might be installed. By default, value is taken from
options("repos") or set to the CRAN cloud repository.
A character vector passed to the
type argument of
A character vector specifying which dependencies to install (of “Depends”, “Imports”, “Suggests”, etc.). The default,
c("Depends", "Imports", "LinkingTo"). See
install.packages for a fuller explanation.
Additional arguments to control installation of package, passed to
A named character vector of R package versions installed.
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)