require.package {ProjectTemplate} | R Documentation |
Require a package for use in the project
Description
This functions will require the given package. If the package is not installed it will stop execution and print a message to the user instructing them which package to install and which function caused the error.
Usage
require.package(package.name, attach = TRUE)
Arguments
package.name |
A character vector containing the package name. Must be a valid package name installed on the system. |
attach |
Should the package be attached to the search path (as with
|
Details
The function .require.package
is called by internal code. It will
attach the package to the search path (with a warning) only if the
compatibility configuration attach_internal_libraries
is set to
TRUE
. Normally, packages used for loading data are not
needed on the search path, but not loading them might break existing code.
In a forthcoming version this compatibility setting will be removed,
and no packages will be attached to the search path by internal code.
Value
No value is returned; this function is called for its side effects.
Examples
library('ProjectTemplate')
## Not run: require.package('PackageName')