Learn R Programming

deps (version 0.4.0)

install: Install Dependencies

Description

Install dependencies from an existing dependencies.json file or after discovering the dependencies.

Usage

install(
  dir = getwd(),
  file = "dependencies.json",
  upgrade = "never",
  cleanup = TRUE,
  timeout = 300L,
  ask = TRUE,
  ...
)

Value

Returns NULL invisibly. The side effect is the dependencies installed.

Arguments

dir

Path to the directory where the JSON file should be written to.

file

The name of the file to be save, default is "dependencies.json". If the file is not found in dir, create() is called.

upgrade

Should package dependencies be upgraded? Argument passed to remotes functions.

cleanup

Logical, clean up files created by create() when file does not exist.

timeout

Integer, timeout for file downloads (default 60 seconds can be short).

ask

Logical, asking confirmation before writing the dependencies.json file.

...

Other argument passed to remotes functions.

Examples

Run this code
dir <- system.file("examples/01-basic", package = "deps")
out <- tempdir()
create(dir, output = out, ask = interactive())
cat(readLines(file.path(out, "dependencies.json")), sep = "\n")
if (FALSE) {
install(out)
}
unlink(file.path(out, "dependencies.json"))

Run the code above in your browser using DataLab