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

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Fri Feb 7 17:33:38 CET 2025


On 7 February 2025 at 11:15, Duncan Murdoch wrote:
| 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.

Both parts are true, but the addition of the test is new in r-devel, and that
was the point I made.

I have been on record for years stating that 'Depends != Suggests' (title of
an old blog post of mine; these days it would be 'Imports != Suggests'),
particularly in the context of tests. But I also happened to at times have
tucked some code away in demo/ _precisely because_ it would not lead to
inflating Suggests. And in those cases I now use examples/, or bite the
bullet and expand Suggests.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list