OHDSI Home | Forums | Wiki | Github

Picking a target R version for HADES

The Health Analytics Data-to-Evidence Suite (HADES) is a collection of open source R packages developed by OHDSI and used in pretty much every OHDSI study. Because they are R packages, they are part of the R ecosystem. A new version of R is released roughly every six months, and the CRAN library of R packages is continuously updated to run on the latest version of R. HADES has up to now followed this practice, meaning that HADES would always run on the latest version of R with the latest version of packages in CRAN.

However, this approach has been showing problems; For better reproducibility (and stability), we’ve started requiring specific versions of dependencies, through the renv package. But some of the (slightly) older versions of packages we’re using don’t work on newer versions of R. These packages have since been fixed in CRAN, but not the version we specified in our R lock files. For this reason, it is for example not possible to use any of the study packages generated by ATLAS (or Hydra, which is used by ATLAS) on R 4.3.0.

To provide a more stable execution environment, we’ve therefore selected a specific R version we’ll target for HADES. For the foreseeable future, HADES will run on R 4.2.3. We therefore encourage everyone to start using R 4.2.3.

This does mean we’ll need to rely more and more on renv, since the packages in CRAN will at some point be updated to versions that no longer run on R 4.2.3. We’re looking into alternatives to CRAN where package versions binaries are archived (unlike CRAN), to make it easier to install the packages that still run on R 4.2.3. We’ll also need to update our HADES continuous integration infrastructure to make sure we test our packages on R 4.2.3, instead of the latest version of R.

We’ll revisit the R version to target every six months, to coincide with a new HADES-wide release (April 1st and October 1st). The current release, captured in this renv lock file, works on R 4.2.3.

On this issue, there may be a solution to hosting a CRAN-like repository via Sonatype Nexus (which is the same software we use to host our Java Maven repositories, so this infrastructure may already be here (@lee_evans can confirm). There has been activity in the renv community checking the support for binary + source packages in Nexus repositories, and it seems to work.

For Strategus/OHDSI study execution, configuring a Nexus R-Repository and using these options when you invoke renv:

options(renv.nexus.enabled = TRUE)
renv::install(<package>)

Should resolve binary fetching by falling back to a nexus repository, with additional configuration (shown here) to point to a Nexus URL. This Nexus URL can proxy to CRAN so that you can automatically fetch available resources from cran, and it will fall back to the Nexus repo if a prior version is requested.

1 Like
t