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

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Feb 7 17:15:38 CET 2025


On 2025-02-07 10:09 a.m., Dirk Eddelbuettel wrote:
> 
> On 7 February 2025 at 05:05, Richard M. Heiberger wrote:
> | Michael and Brian.
> |
> | thank you
> | exactly correct.
> 
> For completeness: this check is a fairly recent addition to r-devel and hence
> a 'policy change'.
> 

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



More information about the R-package-devel mailing list