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()
)
Path to the DESCRIPTION file.
The name of your R package.
The title of your R package.
The description of your R package.
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.
The name of your R package's GitHub repository.
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.
R package Depends. Defaults to the version of R that the current development version of Bioconductor depends on.
R package Imports. These dependencies will be automatically installed with your R package.
R package Suggests. These dependencies will NOT be automatically installed with your R package, unless otherwise specified by users during installation
R package Remotes
The current version of your R package (e.g 0.99.0).
R package license. See here for guidance.
R package Encoding.
R package VignetteBuilder.
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 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.
A URL where users of your package should go if they encounter bugs or have feature requests.
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.
Print messages.
A named list of additional fields to fill the
DESCRIPTION file with: e.g. list(RoxygenNote=7.2.3)
An object of class description.
#### 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.5)
#> 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/RtmppaN4bb/file11e260993437DESCRIPTION