Skip to contents

Check the Availability of a Package

Usage

assert_package(x, ask = TRUE)

needs(x, ask = TRUE)

Arguments

x

A character vector naming the packages to check.

ask

A logical scalar: should the user be asked to select packages before they are downloaded and installed?

Value

Invisibly returns NULL.

Details

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().

Author

N. Frerebeau