Learn R Programming

emil (version 2.2.10)

nice_require: Load a package and offer to install if missing

Description

If running R in interactive mode, the user is prompted for installing missing packages. If running in batch mode an error is thrown.

Usage

nice_require(pkg, reason)

Arguments

pkg

Package name.

reason

A status message that informs the user why the package is needed.

Value

Nothing

Examples

Run this code
# NOT RUN {
nice_require("base", "is required to do anything at all")
# }

Run the code above in your browser using DataLab