packages: Conveniently load and install packages

Description Usage Arguments Author(s) See Also Examples

Description

packages loads and, if necessary, installs packages. Adapted from the glibrary function in the repsych package. Packages can be installed from both CRAN and GitHub.

Usage

1
2
packages(..., repos = "http://cran.r-project.org", dep = TRUE,
  lib.loc = NULL, quietly = FALSE, warn.conflicts = TRUE)

Arguments

...

comma seperated package names and/or GitHub repository address. In case of the latter, ensure that you enter the address as a character in the format username/repo (or username/repo/subdir if necessary).

repos

URL of the repository to use, see install.packages.

dep

logical indicating whether to also install packages which the requested packages depend on / link to / import / suggest. See install.packages.

lib.loc

character vector describing the location of R library trees to search for, or NULL. See require.

quietly

logical indicating whether warning / error messages from install.packages, install_github, and require should be printed.

warn.conflicts

logical indicating whether require warnings about conflicts from attaching a new package should be printed.

Author(s)

Frank H. Hezemans, Frank.Hezemans@mrc-cbu.cam.ac.uk

See Also

install.packages, install_github, require

Examples

1
2
packages(ggplot2) # Install and load from CRAN
packages(ggplot2, "hrbrmstr/hrbrthemes") # Load packages from CRAN and GitHub in one line

frankhezemans/fhTools documentation built on May 7, 2019, 3:14 p.m.