[R-pkg-devel] (Not) Reporting minimum R version in DESCRIPTION Depends Field
On Fri, Jul 26, 2019 at 8:46 AM Ben Bolker <bbolker at gmail.com> wrote:
I'd add: as far as I know CRAN policy would only require you to report the minimum version if your package would fail on one of the older R versions that CRAN still tests (at present I think this goes back to 3.5.2). For regular package developers (i.e. without the resources of RStudio) it's a nuisance to install lots of old versions of R just to find out how far back your package actually works.
If you already use travis, this is pretty easy. All you need is something like: matrix: include: - r: release - r: devel - r: oldrel - r: 3.4 - r: 3.3 - r: 3.2 - r: 3.1 Obviously the challenge is making things work on older versions of R ? in our experience this is either really easy (i.e. you just accidentally used a function that was added to R recently) or really rather hard (your code on works in recent R because of bug that R core fixed) Hadley
IMO it's a little bit obnoxious (albeit maybe unintentionally so) to prevent users who are stuck with earlier versions from using your package without a good reason. (For this reason I try to save RData files that are included in my packages with version=2 so that users with R <3.5.0 aren't left out ...) Unless you know that your package depends on features introduced in a particular version of R, I'd leave it out. If you find out later from users that it breaks on earlier versions, and you can't find a way to enable its use on earlier versions, you can add the dependency in a later release. Ben Bolker On 2019-07-26 10:20 a.m., Hadley Wickham wrote:
I no longer believe this to be good advice - I think you should only declare a specific dependency if you want to strongly assert that your package works with those versions. For example, all tidyverse versions depend on R 3.2 and later, because we test on all those versions. Hadley On Friday, July 26, 2019, Jarrett Phillips <phillipsjarrett1 at gmail.com> wrote:
Hello,
Numerous CRAN packages report minimum R versions within the Depends field
of the DESCRIPTION file.
Is this reporting always necessary?
Hadley Wickham's book "R Packages" states:
"You can also use Depends to require a specific version of R, e.g.
Depends: R
(>= 3.0.1) . As with packages, it?s a good idea to play it safe and require
a version greater than or equal to the version you?re currently using.
devtools::create() will do this for you."
devtools::check() doesn't warn about not specifying R version, so I am just
curious.
Thanks.
Cheers,
Jarrett
[[alternative HTML version deleted]]
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
______________________________________________ R-package-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel