Skip to contents

Install missing package from DESCRIPTION

Usage

install_from_description(
  path = "DESCRIPTION",
  field = c("Depends", "Imports", "Suggests"),
  ...
)

Arguments

path

path to the DESCRIPTION file

field

DESCRIPTION fields to parse, "Depends", "Imports", "Suggests" by default

...

Arguments to be passed to utils::install.packages()

Value

Used for side effect. Installs R packages from DESCRIPTION file if missing.

Examples

if (FALSE) {
# This will install packages on your system
dummypackage <- system.file("dummypackage", package = "attachment")
# browseURL(dummypackage)

install_from_description(path = file.path(dummypackage, "DESCRIPTION"))
}