Press "Enter" to skip to content

Declaring a Minimum R Version in Packages

Hugo Gruson and Maelle Salmon show how to set a minimum version of R itself in a package:

There have been much talk and many blog posts about R package dependencies. Yet, one special dependency is more rarely mentioned, even though all packages include it: the dependency on R itself. 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. In this post we shall explain why and how.

Read on for that explanation, as well as a lot of depth on why you might choose a particular R version, popular R versions (at least by number of packages), and what some of the largest maintainers do.