Skip to contents

Inspects a project directory for the R packages it uses. The detection priority is:

Usage

detect_project_packages(path = ".", include_suggests = FALSE)

Arguments

path

Project path.

include_suggests

Whether to include Suggests from DESCRIPTION.

Value

A character vector of package names.

Details

  1. renv.lock (the Packages map),

  2. DESCRIPTION (Depends, Imports, LinkingTo, and optionally Suggests),

  3. .R, .Rmd, .qmd, and NAMESPACE files (looking for library(), require(), requireNamespace(), and pkg::fun references; line comments are ignored).

See also

Examples

if (FALSE) { # \dontrun{
detect_project_packages(".")
detect_project_packages(".", include_suggests = TRUE)
} # }