Amend DESCRIPTION with dependencies from imports and suggests package list

att_to_desc_from_is(
  path.d = "DESCRIPTION",
  imports = NULL,
  suggests = NULL,
  normalize = TRUE,
  add_remotes = FALSE
)

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

add_remotes

Logical. Whether to add Remotes in DESCRIPTION when packages installed are from non-CRAN.

Value

Fill in Description file

Examples

tmpdir <- tempdir() file.copy(system.file("dummypackage",package = "attachment"), tmpdir, recursive = TRUE)
#> [1] TRUE
dummypackage <- file.path(tmpdir, "dummypackage") # browseURL(dummypackage) att_to_desc_from_is(path.d = file.path(dummypackage, "DESCRIPTION"), imports = c("fcuk", "attachment"), suggests = c("knitr"))
#> Package(s) Rcpp is(are) in category 'LinkingTo'. Check your Description file to be sure it is really what you want.
#> [-] 4 package(s) removed: magrittr, utils, rmarkdown, testthat.
#> [+] 2 package(s) added: attachment, fcuk.
# 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")))
#> Package(s) Rcpp is(are) in category 'LinkingTo'. Check your Description file to be sure it is really what you want.
#> [-] 2 package(s) removed: attachment, fcuk.
#> [+] 3 package(s) added: stats, ggplot2, rmarkdown.