How do you solve the dependencies of packages within your functions? I add require(package) into the function, but I wonder if there’s a preferred way of accomplishing this task.
How do you solve the dependencies of packages within your functions? I add require(package)
Share
According to the function’s help,
require is designed for use inside other functions; it returns FALSE and gives a warning (rather than an error as library() does by default) if the package does not existand later on…
The source code for a package that requires one or more other packages should have a call to require, preferably near the beginning of the source, and of course before any code that uses functions, classes or methods from the other package