A user-friendly version of functions to check if required R packages are installed and have minimum required versions.

check_packages_by_topic(
  list_name = NULL,
  local_list = getOption("bio.local_list", FALSE),
  upgrade = TRUE,
  ...
)

check_packages_by_name(
  pkgs = NULL,
  local_list = getOption("bio.local_list", FALSE),
  upgrade = TRUE,
  ...
)

Arguments

list_name

(character) The name of the list with required R packages. E.g., "mini", "Rcmdr", "Rcmdr-biostat", "bio", etc.

local_list

(logical) If TRUE, the list, which is locally installed in the folder of package bio ("local list"), is used. If FALSE, the list on "GitHub" repository of the package is used. It is recommended using the online version of the list, as it may contain more recent changes. Optiom bight be set globally by, e.g., options(bio.local_list = TRUE).

upgrade

Upgrade dependencies. See upgrade in remotes::install_cran().

...

Further arguments to get_pkgs_installation_status().

pkgs

(character) The name (vector of names) of R packages. Either list_name or pkgs must be NULL.

Value

Function invisibly returns object with package installation status.

Examples

if (FALSE) {
  check_packages_by_topic("mini", local_list = TRUE)

  check_packages_by_topic("mini", include = "always", local_list = TRUE)

  check_packages_by_topic("mini", include = "always", install = "outdated",
   github = "always", local_list = TRUE)


  check_packages_by_name("bio")

  check_packages_by_name(c("bio", "usethis", "ggplot1"))
}