Learn R Programming

gtsummary (version 1.5.0)

assert_package: Check a package installation

Description

The function checks whether a package is installed and returns an error or FALSE if not available. If a package search is provided, the function will check whether a minimum version of a package is required.

Usage

assert_package(pkg, fn = NULL, pkg_search = "gtsummary", boolean = FALSE)

Arguments

pkg

Package required

fn

Calling function from the user perspective

pkg_search

the package the function will search for a minimum required version from.

boolean

logical indicating whether to return a TRUE/FALSE, rather than error when package/package version not available.

Value

Returns NULL or not at all.

Examples

Run this code
# NOT RUN {
assert_package("gt", boolean = TRUE)
# }

Run the code above in your browser using DataLab