Create a dependencies.R in the `inst` folder

create_dependencies_file(
  path = "DESCRIPTION",
  field = c("Depends", "Imports"),
  to = "inst/dependencies.R",
  open_file = TRUE,
  ignore_base = TRUE
)

Arguments

path

path to the DESCRIPTION file

field

DESCRIPTION field to parse, "Import" and "Depends" by default. Can add "Suggests"

to

path to dependencies.R. "inst/dependencies.R" by default

open_file

Logical. Open the file created in an editor

ignore_base

Logical. Whether to ignore package coming with base, as they cannot be installed

Value

Used for side effect. Shows a message with installation instructions and creates a R file containing these instructions.

Examples

tmpdir <- tempdir()
file.copy(system.file("dummypackage",package = "attachment"), tmpdir,
 recursive = TRUE)
#> [1] TRUE
dummypackage <- file.path(tmpdir, "dummypackage")
# browseURL(dummypackage)

create_dependencies_file(path = file.path(dummypackage,"DESCRIPTION"),
to = file.path(dummypackage, "inst/dependencies.R"),
open_file = FALSE)