create_dependencies_file: Create a dependencies.R in the 'inst' folder

View source: R/create_dependencies_file.R

create_dependencies_fileR Documentation

Create a dependencies.R in the inst folder

Description

Create a dependencies.R in the inst folder

Usage

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)
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)

attachment documentation built on Sept. 19, 2022, 5:07 p.m.