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.
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 exist
and 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With