Skip to contents

Wrapper over searching repositories by code blobs related to loading package (library(package) and require(package) in all files) or using it as a dependency (package in DESCRIPTION and NAMESPACE files).

Usage

get_R_package_usage(
  gitstats_object,
  packages,
  only_loading = FALSE,
  split_output = FALSE,
  cache = TRUE,
  verbose = is_verbose(gitstats_object)
)

Arguments

gitstats_object

A GitStats object.

packages

A character vector, names of R packages to look for.

only_loading

A boolean, if TRUE function will check only if package is loaded in repositories, not used as dependencies.

split_output

Optional, a boolean. If TRUE will return a list of tables, where every element of the list stands for the package passed to packages parameter. If FALSE, will return only one table with name of the package stored in first column.

cache

A logical, if set to TRUE GitStats will retrieve the last result from its storage.

verbose

A logical, TRUE by default. If FALSE messages and printing output is switched off.

Value

A tibble or list of tibbles depending on split_output parameter.

Examples

if (FALSE) { # \dontrun{
 my_gitstats <- create_gitstats() %>%
  set_github_host(
    token = Sys.getenv("GITHUB_PAT"),
    orgs = c("r-world-devs", "openpharma")
  )

 get_R_package_usage(
   gitstats_object = my_gitstats,
   packages = c("purrr", "shiny"),
   split_output = TRUE
 )
} # }