From x|e @end|ng |rom y|hu|@n@me  Fri Dec 13 21:52:56 2024
From: x|e @end|ng |rom y|hu|@n@me (Yihui Xie)
Date: Fri, 13 Dec 2024 14:52:56 -0600
Subject: [Rd] Check R version dependency in R CMD Check
In-Reply-To: <CAL3ufU+P6Ov1+m-Y=jvmRwC04aCgF1Na3raBpuSMV3ghO6-MjQ@mail.gmail.com>
References: <CA+6hu7eMvwn_BxHm_h6WXgZx979gQywUDPcbexgQJQtQ4dZqBw@mail.gmail.com>
 <CAL3ufU+P6Ov1+m-Y=jvmRwC04aCgF1Na3raBpuSMV3ghO6-MjQ@mail.gmail.com>
Message-ID: <CANROs4c4p_LWbaGg=fHmPZY8ZCS-hKWZ_oUN7KZf_1BGOoG2_Q@mail.gmail.com>

For package authors using Github Action, one reason why they forget to
actually check their packages against the minimal R version specified
in DESCRIPTION may be the use of _relative_ versions in the workflows
like this: https://github.com/r-lib/actions/blob/v2/examples/check-full.yaml
i.e., checking against the 5 last minor releases of R (and this
example workflow says even 5 is likely to be an overkill and
recommends people to test only one old release instead). As a result,
as R makes new releases, packages will not be tested against older
versions of R anymore and package authors won't notice it.

Speaking of guilt, someone has a package that states `Depends: R (>=
3.6.0)` (by coincidence):
https://github.com/yihui/knitr/blob/master/DESCRIPTION#L117 but it's
only checked against R >= 4.0.x (oldrel-4) at the moment:
https://github.com/yihui/knitr/blob/master/.github/workflows/R-CMD-check.yaml#L41

To ensure the package is checked against the minimal R version and
above, we'd have to enumerate all version numbers like this:
https://github.com/yihui/litedown/blob/main/.github/workflows/R-CMD-check.yaml#L19-L29
And this list needs to be updated after each new release of R.

I'm not sure if Jan was proposing to CRAN or package authors for such
checks, but I feel this is primarily the responsibility of package
authors.

Regards,
Yihui

On Fri, Dec 13, 2024 at 1:51?PM Josiah Parry <josiah.parry at gmail.com> wrote:
>
> I?ve been guilty of this myself. I think a check would be good.
>
> In my case I was using the new sort_by() function (I think also 4.1) and a
> user was failing to install on R 4.0.
>
>
> On Fri, Dec 13, 2024 at 11:30 Jan Net?k <netikja at gmail.com> wrote:
>
> > Hello,
> >
> > I have a server with R 3.6.3 installed and I struggled a bit with
> > updating several R packages that utilizes some new syntax introduced in R
> > 4.1.0, such as the native pipe |> or function definition shorthand \(x) ...
> >
> > The thing is that these packages states "Depends: R (>= 3.6.0)" and pass R
> > CMD Check without any issues. My problem occurred at the installation time.
> > I can see that developers naturally include the new handy syntax but
> > oftentimes forget to raise R version dependency in their DESCRIPTIONs.
> > Should we employ some new checks?
> >
> > Best,
> > Jan



[Rd] Check R version dependency in R CMD Check
Yihui Xie