Install missing package from DESCRIPTION

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) {
dummypackage <- system.file("dummypackage", package = "attachment")
# browseURL(dummypackage)

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