Press "Enter" to skip to content

Getting The Right R Version For Packages

Colin Gillespie shows a couple methods for figuring out the minimum version of R needed for a set of packages:

In R, there is a handy function called available.packages() that returns a matrix of details corresponding to packages currently available at one or more repositories. Unfortunately, the format isn’t initially amenable to manipulation. For example, consider the readr package

readr_desc = available.packages() %>% as_tibble() %>% filter(Package == "readr")

I immediately converted the data to a tibble, as that

  • changed the rownames to a proper column

  • changed the matrix to a data frame/tibble, which made selecting easier

There’s a good use of R functionality to delve into package requirements, as well as a script to try it out yourself.