att_to_desc_from_is: Amend DESCRIPTION with dependencies from imports and suggests...

Description Usage Arguments Details Value Examples

View source: R/att_to_description.R

Description

Amend DESCRIPTION with dependencies from imports and suggests package list

Usage

1
2
3
4
5
6
7
att_to_desc_from_is(
  path.d = "DESCRIPTION",
  imports = NULL,
  suggests = NULL,
  normalize = TRUE,
  must.exist = TRUE
)

Arguments

path.d

path to description file.

imports

character vector of package names to add in Imports section

suggests

character vector of package names to add in Suggests section

normalize

Logical. Whether to normalize the DESCRIPTION file. See desc_normalize

must.exist

Logical. If TRUE then an error is given if packages do not exist within installed packages. If NA, a warning.

Details

'must.exist' is better set to 'TRUE' during package development. This stops the process when a package does not exists on your system. This avoids check errors with typos in package names in DESCRIPTION. When used in CI to discover dependencies, for a bookdown for instance, you may want to set to 'FALSE' (no message at all) or 'NA' (warning for not installed).

Value

Fill in Description file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tmpdir <- tempdir()
file.copy(system.file("dummypackage",package = "attachment"), tmpdir,
 recursive = TRUE)
dummypackage <- file.path(tmpdir, "dummypackage")
# browseURL(dummypackage)
att_to_desc_from_is(path.d = file.path(dummypackage, "DESCRIPTION"),
imports = c("magrittr", "attachment"), suggests = c("knitr"))
# In combination with other functions
att_to_desc_from_is(path.d = file.path(dummypackage, "DESCRIPTION"),
imports = att_from_rscripts(file.path(dummypackage, "R")),
suggests = att_from_rmds(file.path(dummypackage, "vignettes")))

attachment documentation built on Nov. 16, 2021, 9:17 a.m.