Fill out a DESCRIPTION file, such as (but not limited to) the one provided by the templateR R package template. For any given field, set its corresponding argument as follows to get certain behaviour:

NULL:

Keeps the current value.

NA:

Removes the field from the DESCRIPTION file entirely.

fill_description(
  path = here::here("DESCRIPTION"),
  package,
  title,
  description,
  github_owner = NULL,
  github_repo = package,
  authors = construct_authors(authors = NULL),
  depends = paste0("R ", "(>= ", bioc_r_versions(bioc_version = "devel", depth = 2)$r,
    ")"),
  imports = infer_deps(path = path, which = "Imports", add_newlines = TRUE),
  suggests = infer_deps(path = path, which = "Suggests", add_newlines = TRUE),
  remotes = NULL,
  version = NULL,
  license = NULL,
  encoding = NULL,
  vignettebuilder = NULL,
  biocviews = infer_biocviews(pkgdir = dirname(path), add_newlines = TRUE),
  url = paste0("https://github.com/", github_owner, "/", github_repo),
  bugreports = paste0(url, "/issues"),
  save_path = path,
  verbose = TRUE,
  fields = list()
)

Arguments

path

Path to the DESCRIPTION file.

package

The name of your R package.

title

The title of your R package.

description

The description of your R package.

github_owner

The owner of your R package's GitHub repository. Can be inferred from the URL field in the DESCRIPTION file if this has already been filled out.

github_repo

The name of your R package's GitHub repository.

authors

A list of authors who contributed to your R package, each provided as objects of class person. By default, if an Authors field already exists in the DESCRIPTION file, the original values are kept. Otherwise, a template person list is created using the construct_authors.

depends

R package Depends. Defaults to the version of R that the current development version of Bioconductor depends on.

imports

R package Imports. These dependencies will be automatically installed with your R package.

suggests

R package Suggests. These dependencies will NOT be automatically installed with your R package, unless otherwise specified by users during installation

remotes

R package Remotes

version

The current version of your R package (e.g 0.99.0).

license

R package license. See here for guidance.

encoding

R package Encoding.

vignettebuilder

R package VignetteBuilder.

biocviews

Standardised biocViews terms used to describe your package. Defaults to automatically recommending terms using the infer_biocviews function. Note that non-Bioconductor packages (e.g. CRAN) can also use this field.

url

URL where your R package is distributed from (e.g. GitHub repository, Bioconductor page, and/or CRAN page). Can be a single character string or a character vector.

bugreports

A URL where users of your package should go if they encounter bugs or have feature requests.

save_path

Path to save the updated DESCRIPTION file to. Defaults to overwriting the input file (path). Set to NULL if you wish to only return the description object without writing to any file.

verbose

Print messages.

fields

A named list of additional fields to fill the DESCRIPTION file with: e.g. list(RoxygenNote=7.2.3)

Value

An object of class description.

Examples

#### Get example DESCRIPTION file ####
url <- "https://github.com/neurogenomics/templateR/raw/master/DESCRIPTION" 
path <- tempfile(fileext = "DESCRIPTION")
utils::download.file(url,path)

#### Fill out DESCRIPTION file ####
d <- fill_description(
  path = path,
  package = "MyPackageName",
  title = "This Package Does Awesome Stuff",
  description = paste(
    "MyPackageName does several awesome things.",
    "Describe thing1.",
    "Describe thing2.",
    "Describe thing3."
  ),
  github_owner = "OwnerName",
  biocviews = c("Genetics", "SystemsBiology"))
#> Finding R package dependencies ... Done!
#> Updating: Package --> MyPackageName
#> Updating: Title --> This Package Does Awesome Stuff
#> Updating: Description --> MyPackageName does several awesome things. Describe thing1. Describe thing2. Describe thing3.
#> Updating: Authors --> yourGivenName yourFamilyName <yourEmail@email.com> [cre] (yourOrcidId)
#> Updating: Depends --> R (>= 4.4)
#> Updating: Suggests --> 
#>   testthat, 
#>   rmarkdown, 
#>   markdown, 
#>   knitr, 
#>   remotes, 
#>   covr
#> Updating: biocViews --> Genetics, SystemsBiology
#> Updating: URL --> https://github.com/OwnerName/MyPackageName
#> Updating: BugReports --> https://github.com/OwnerName/MyPackageName/issues
#> Saving updated file: /tmp/RtmpT6qXye/file4bb7fe2be16DESCRIPTION