infer_deps {rworkflows} | R Documentation |
Infer dependencies
Description
Infers the R packages that your R package depends on.
Usage
infer_deps(
path = here::here("DESCRIPTION"),
which = c("Imports", "Suggests"),
imports_thresh = 2,
imports = NULL,
suggests = c("testthat", "rmarkdown", "markdown", "knitr", "remotes", "knitr", "covr"),
errors = c("reported", "fatal", "ignored"),
dev = FALSE,
progress = TRUE,
add_newlines = FALSE
)
Arguments
path |
The path to a |
which |
Which types of dependencies to return. |
imports_thresh |
The minimum number of times that a package has to be called within your package to assign it as an Import. If is called less times than this threshold, it will instead be assigned as a Suggest, which means it will not be installed by default. |
imports |
R packages that are exempt from the |
suggests |
R packages that are exempt from the |
errors |
How should errors that occur during dependency enumeration be handled?
|
dev |
Boolean; include development dependencies? These packages are typically required when developing the project, but not when running it (i.e. you want them installed when humans are working on the project but not when computers are deploying it). Development dependencies include packages listed in the |
progress |
Boolean; report progress output while enumerating dependencies? |
add_newlines |
Prefix each package name with a newline character and two spaces. This is useful for formatting DESCRIPTION files. |
Value
A character vector of R package names.
Examples
#### Get example DESCRIPTION file ####
url <- "https://github.com/neurogenomics/templateR/raw/master/DESCRIPTION"
path <- tempfile(fileext = "DESCRIPTION")
utils::download.file(url,path)
deps <- infer_deps(path = path)