Learn R Programming

broom.helpers (version 1.7.0)

assert_package: Check a package installation status or minimum required version

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 = "broom.helpers", boolean = FALSE)

.get_min_version_required(pkg, pkg_search = "broom.helpers")

Arguments

pkg

Package required

fn

Calling function from the user perspective. Used to write informative error messages.

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. Default is FALSE, which will return an error if pkg is not installed.

Value

logical or error

Examples

Run this code
# NOT RUN {
.assert_package("broom", boolean = TRUE)

.get_min_version_required("brms")
# }

Run the code above in your browser using DataLab