29

I am submitting my R package to CRAN, and am receiving a warning from the CRAN servers that does not appear when I run R CMD CHECK --as-cran locally on the package tarball prior to uploading to CRAN. This causes my package to fail the automatic CRAN check.

This is the warning:

* checking DESCRIPTION meta-information ... WARNING
Dependence on R version '3.4.3' not with patchlevel 0

My DESCRIPTION file contains this line:

Depends: R (>= 3.4.3)

What does this warning mean? Thanks!

Pamela
  • 315
  • 3
  • 4

2 Answers2

38

From the latest version of Writing R Extensions we note, from Section 1.1.3:

It is inadvisable to use a dependence on R with patchlevel (the third digit) other than zero. Doing so with packages which others depend on will cause the other packages to become unusable under earlier versions in the series, and e.g. versions 3.x.1 are widely used throughout the Northern Hemisphere academic year.

The patchlevel is z in R x.y.z, so you are specifying a patchlevel of 3 for the 3.4 point release, and that is what is being warned against.

Do you need to depend on this particular patchlevel?

Gavin Simpson
  • 170,508
  • 25
  • 396
  • 453
  • 1
    Is there a way to make `devtools::create_description` default to patchlevel 0? Ideally without using `options(devtools.desc = list(Depends = "3.5.0"))`, which would make my code obsolete as soon as 3.6.0 is released. Thanks... sorry, should have googled a bit more. `sessionInfo()$R.version$minor` returns the value I need. – Josh May 23 '19 at 10:42
  • “Do you need to depend on this particular patchlevel?” — Yes, absolutely. This is perfectly sensible if a package depends on a feature that was broken in previous versions of that particular minor version. In fact, depending on the latest patch level of a minor version is often more meaningful than depending on the next minor version (particularly in the case of R 3.6). Shame that CRAN doesn’t agree. – Konrad Rudolph Aug 12 '23 at 10:49
24

That was discussed recently on the (excellent) r-package-devel list: Such dependencies should be made to the 'zero' level, ie R (>= 3.4.0).

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725