Learn R Programming

cards (version 0.3.0)

check_pkg_installed: Check Package Installation

Description

  • check_pkg_installed(): checks whether a package is installed and returns an error if not available, or interactively asks user to install missing dependency. If a package search is provided, the function will check whether a minimum version of a package is required and installed.

  • is_pkg_installed(): checks whether a package is installed and returns TRUE or FALSE depending on availability. If a package search is provided, the function will check whether a minimum version of a package is required and installed.

  • get_pkg_dependencies() returns a tibble with all dependencies of a specific package.

  • get_min_version_required() will return, if any, the minimum version of pkg required by reference_pkg.

Usage

check_pkg_installed(pkg, reference_pkg = "cards", call = get_cli_abort_call())

is_pkg_installed(pkg, reference_pkg = "cards", call = get_cli_abort_call())

get_pkg_dependencies( reference_pkg = "cards", lib.loc = NULL, call = get_cli_abort_call() )

get_min_version_required( pkg, reference_pkg = "cards", lib.loc = NULL, call = get_cli_abort_call() )

Value

is_pkg_installed() and check_pkg_installed() returns a logical or error, get_min_version_required() returns a data frame with the minimum version required, get_pkg_dependencies() returns a tibble.

Arguments

pkg

(character)
vector of package names to check.

reference_pkg

(string)
name of the package the function will search for a minimum required version from.

call

(environment)
frame for error messaging. Default is get_cli_abort_call().

lib.loc

(path)
location of R library trees to search through, see utils::packageDescription().

Examples

Run this code
check_pkg_installed("dplyr")

is_pkg_installed("dplyr")

get_pkg_dependencies()

get_min_version_required("dplyr")

Run the code above in your browser using DataLab