Check the Availability of a Package
assert_package(x, ask = TRUE)needs(x, ask = TRUE)
Invisibly returns NULL
.
N. Frerebeau
assert_package()
is designed for use inside other functions in your own
package to check for the availability of a suggested package.
If the required packages are not available and R is running interactively, the user will be asked to install the packages.
needs()
is an alias for assert_package()
.
Other validation methods:
assert_constant()
,
assert_data
,
assert_length()
,
assert_lower()
,
assert_names()
,
assert_numeric
,
assert_square()
,
assert_type()
,
validate()