Skip to content

[R-pkg-devel] How to resolve missing packages without Notes

3 messages · Dirk Eddelbuettel, Stephen Abrams

#
Hi again - I'm working through the final details of a submission. My
current problem is that I make use of a dependency of the caret package
(kernlab) in one of my vignettes. If I don't include kernlab in my
DESCRIPTION file, I get the following ERROR:

* checking re-building of vignette outputs ... [16s] ERROR
Error(s) in re-building vignettes:
--- re-building 'create_synthetic_data.Rmd' using rmarkdown
--- finished re-building 'create_synthetic_data.Rmd'

--- re-building 'modeling_with_binary_classifiers.Rmd' using rmarkdown

Quitting from lines 56-63 [unnamed-chunk-4]
(modeling_with_binary_classifiers.Rmd)
Error: processing vignette 'modeling_with_binary_classifiers.Rmd' failed
with diagnostics:
Required packages are missing: kernlab
--- failed re-building 'modeling_with_binary_classifiers.Rmd'

If I do include kernlab as a dependency in my DESCRIPTION file, I get the
following NOTE:

* checking dependencies in R code ... NOTE
Packages in Depends field not imported from:
  'kernlab' 'randomForest'
  These packages need to be imported from (in the NAMESPACE file)
  for when this namespace is loaded but not attached.

My NAMESPACE file is auto-generated by roxygen and actually says not to
edit it. I think the problem is the implicit dependency inside caret, but
I'm not sure how to solve it so the automated checks work. When I run this
on my own machine, it passes the --as-cran check. Any advice would be
greatly appreciated.

Thanks!
#
On 9 March 2025 at 15:03, Stephen Abrams wrote:
| Hi again - I'm working through the final details of a submission. My
| current problem is that I make use of a dependency of the caret package
| (kernlab) in one of my vignettes. If I don't include kernlab in my
| DESCRIPTION file, I get the following ERROR:
[...]
| My NAMESPACE file is auto-generated by roxygen and actually says not to

You need to edit DESCRIPTION (by hand). That is all that there is, and
_Writing R Extensions_ is fairly clear about this. Here is a quote from
Section 1.1.3

     The ?Suggests? field uses the same syntax as ?Depends? and lists
  packages that are not necessarily needed.  This includes packages used
  only in examples, tests or vignettes (*note Writing package
  vignettes::), and packages loaded in the body of functions.

Dirk
#
Awesome - much appreciated. I think I'm missing the forest for the trees at
this point - thanks!
On Sun, Mar 9, 2025 at 3:12?PM Dirk Eddelbuettel <edd at debian.org> wrote: