Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

packages

Loading Packages


Description

require.quiet silently requires a package, and qrequire is an alias to require.quiet.

Usage

require.quiet(...)

qrequire(...)

qlibrary(...)

mrequire(msg, package, lib.loc = NULL, quietly = FALSE)

Arguments

...

extra arguments passed to library or require.

msg

error message to use, to which is appended the string ' requires package <pkg>' to build the error message.

package

name of the package to load.

lib.loc

a character vector describing the location of R library trees to search through, or NULL. The default value of NULL corresponds to all libraries currently known to .libPaths(). Non-existent library trees are silently ignored.

quietly

a logical. If TRUE, no message confirming package attaching is printed, and most often, no errors/warnings are printed if package attaching fails.

Functions

  • qlibrary: silently loads a package.

  • mrequire: tries loading a package with base require and stops with a – custom – error message if it fails to do so.

See Also

Other require: irequire()

Examples

mrequire('Running this example', 'stringr')
try( mrequire('Doing impossible things', 'notapackage') )

pkgmaker

Development Utilities for R Packages

v0.32.2
GPL (>= 2)
Authors
Renaud Gaujoux [aut, cre]
Initial release
2020-10-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.