[R-pkg-devel] Vignettes & _R_CHECK_DEPENDS_ONLY_=true

Henrik Bengtsson henr|k@bengt@@on @end|ng |rom gm@||@com
Thu Jun 9 18:23:48 CEST 2022


On Thu, Jun 9, 2022 at 8:53 AM Arne Henningsen
<arne.henningsen using gmail.com> wrote:
>
> Dear all
>
> My R package "systemfit" has a 'vignette' that uses the R packages
> "plm" and "sem", while the actual code of the "systemfit" package does
> not depend on these two packages. Currently, the "systemfit" package
> 'Suggests' the "plm" package and the "sem" package. However, CRAN
> started to check packages with '_R_CHECK_DEPENDS_ONLY_=true' so that
> the checking of the "systemfit" package returns an error message
> because the vignette cannot be created without the "plm" and "sem"
> packages.

Also, the case for one of your example, cf.
https://cran.r-project.org/web/checks/check_results_systemfit.html

> I am considering changing the DESCRIPTION file so that the
> "systemfit" package will 'Depend' on the "plm" and "sem" packages
> (although only the vignette depends on these two packages). Is this
> the recommended way to do or is there a better way to make the
> "systemfit" package pass the tests at CRAN?

To keep them as Suggests:ed packages, you need to run the code in your
examples and vignettes that rely on them conditionally on the being
installed, e.g.

if (requireNamespace("plm", quietly = TRUE)) {
  ...
}

FWIW, you're using Sweave, but if you'd used knitr, there are easy
ways to do this also for vignettes.  I forgot the details, but I saw a
simple solution the other week somewhere out there on the interwebs.

If you don't want to do this, then yes, you need to turn those
dependencies into hard dependencies, e.g. Depends or Imports.

/Henrik

>
> Best wishes,
> Arne
>I
> --
> Arne Henningsen
> http://www.arne-henningsen.name
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel



More information about the R-package-devel mailing list