[Rd] Depends/Imports/Suggest/Enhence

Davor Cubranic cubranic at stat.ubc.ca
Tue Nov 6 20:44:08 CET 2012

On 2012-11-06, at 9:49 AM, Uwe Ligges wrote:

> On 06.11.2012 17:55, Christophe Genolini wrote:
>>> "Imports" means that symbols are imported form the namespace, so they
>>> are mandatory for the package to operate. "Suggests" means that
>>> symbols from the package are not required, but they are used in
>>> examples or vignettes, so the listed package(s) will be needed for a
>>> full check. They are not needed for the operation of the package, though.
>> That's very clear, thanks a lot.
>> So I will use
>>  - 'Depends:foo1' if there is a function in foo1 that my package use often
> No, better make use of Namespace imports all the time and only use "Depends" if you really need the other package to be installed. This is rarely needed.

Uwe, did you mean to say "only use 'Depends' if the other package really needs to be *attached*"? Because in terms of determining dependencies for `install.package`, I thought "Imports" and "Depends" are no different. (Unless the user explicitly chooses otherwise in the 'dependencies' argument, that is.)

>> - 'Imports:foo2' if there is a function in foo2 that my package might
>> use rarely

I don't think choosing to declare "Imports" has anything to do with frequency of use. But if you do use it, then don't forget to include "imports(foo2)" or "importsFrom(foo2, ...)" in the NAMESPACE file.


More information about the R-devel mailing list