
This means that their packages might work with older R versions, but because they don’t or can’t test it, they’d rather not take the risk and limit themselves to versions for which they are sure the package is working: Some projects prefer to limit the minimum R version by design, rather than by necessity. There are different strategies to choose on which R version your package should depend: Conservative approach To do so, you should add the required version number to your DESCRIPTION file 2:ĭepends : R (>= 3.5.0) Which minimum R version your package should depend on? In this situation, you should inform users ( as well as automated checks from CRAN) that your package only works for R versions more recent than a given number 1. As a package developer, you may want to use one of these newly added features (such as startsWith(), introduced in R 3.3.0). Many exciting new features keep being regularly added to R or some of its base libraries. How & why to declare a dependency to a minimum R version?Īlthough the R project is in a stable state, and prides itself in its solid backward compatibility, it is far from being a dead project.

In this post we shall explain why and how. The same way you can specify a dependency on a package, and optionally on a specific version, you can add a dependency to a minimum R version in the DESCRIPTION file of your package. Yet, one special dependency is more rarely mentioned, even though all packages include it: the dependency on R itself.

There have been much talk and many blog posts about R package dependencies.
