These functions search for patterns, such as library(pkg)
, require(pkg)
,
pkg::function()
, or data(package = "pkg")
and return package names from
these expressions.
list_pkgs_used_in_dir(path = ".", regexp = "(?i)[.](rmd|r)$", ...)
list_pkgs_used_in_files(files)
Path to directory with R and R Markdown files. Defaults to "."
.
Regular expression to filter file names. Defaults to R and Rmd files.
Further arguments to fs::dir_ls.
Path to R or Rmd files
Character vector with package names.