Skip to contents

Inspired by Lisa DeBruine's gist

Usage

discover_libraries(
  path = ".",
  pattern = "\\.Rmd$|\\.qmd$|\\.r$|\\.R$",
  recursive = TRUE
)

Arguments

path

the root of the project to look for

pattern

the file types to analyse (default: .R, .r, .qmd, .Rmd)

recursive

search files recursively (default: TRUE)

Value

list of library names

See also

Other libraries: list_missing_libraries()

Examples

if (FALSE) { # \dontrun{
find_libraries(".")
} # }