assert_package: Check a package installation status or minimum required version
Description
The function .assert_package() 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.
The function .get_package_dependencies() returns a tibble with all
dependencies of a specific package. Finally, .get_min_version_required()
will return, if any, the minimum version of pkg required by pkg_search,
NULL if no minimum version required.
logical or error for .assert_package(), NULL or character with
the minimum version required for .get_min_version_required(), a tibble for
.get_package_dependencies().
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.
remove_duplicates
if several versions of a package are installed,
should only the first one be returned?