Skip to content
Prev 11286 / 12125 Next

[R-pkg-devel] [External] 'library' or 'require' call not declared

On 2025-02-07 10:09 a.m., Dirk Eddelbuettel wrote:
I don't think it's a policy change:  it's documented that all packages 
used in package code need to be declared.

Writing R Extensions in 4.4.2 says "All packages that are needed to 
successfully run R CMD check on the package must be listed in one of 
?Depends? or ?Suggests? or ?Imports?. Packages used to run examples or 
tests conditionally (e.g. via if(require(pkgname))) should be listed in 
?Suggests? or ?Enhances?. (This allows checkers to ensure that all the 
packages needed for a complete check are installed.)"

It may be that the tests weren't enforcing this rule until recently, but 
I think the rule has been there for a long time.

Duncan