install_github: Install R package from GitHub

Description Usage Arguments Value Author(s) Examples

Description

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 devtools::install_github().

Usage

1
2
3
4
install_github(repo, host = "github.com", credentials = NULL,
  build_args = NULL, build_vignettes = TRUE, uninstall = FALSE,
  verbose = FALSE, repos = NULL, type = "source", dependencies = NA,
  ...)

Arguments

repo

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 (“leeper/ghit@v0.2”), or subdirectory (“leeper/ghit/R”). These arguments can be placed in any order and in any combination (e.g., “leeper/ghit[master]@abc123/R”).

host

A character string naming a host, to enable installation of enterprise-hosted GitHub packages.

build_args

A character string used to control the package build, passed to R CMD build.

build_vignettes

A logical specifying whether to build package vignettes, passed to R CMD build. Can be slow. Note: The default is TRUE, unlike in devtools::install_github().

uninstall

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.

verbose

A logical specifying whether to print details of package building and installation.

repos

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.

type

A character vector passed to the type argument of install.packages.

dependencies

A character vector specifying which dependencies to install (of “Depends”, “Imports”, “Suggests”, etc.). The default, NA, means c("Depends", "Imports", "LinkingTo"). See install.packages for a fuller explanation.

...

Additional arguments to control installation of package, passed to install.packages.

credentials

An

argument passed to the credentials argument to clone. See cred_user_pass or cred_ssh_key.

Value

A named character vector of R package versions installed.

Author(s)

Thomas J. Leeper

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
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)

## End(Not run)

cloudyr/ghit documentation built on May 13, 2019, 8:20 p.m.