Get the latest stable R version number programmatically

How can I use R to get the latest version of R? I know about gtools::checkRVersion

but was hoping for a basic solution, even the best one that doesn't rely on scraping / regex.

The desired result to date (2015-06-13) would be as follows: 3.2.0

+3


source to share


3 answers


Using the METRCAN API (@Roland's comment):



library(RJSONIO)
fromJSON("http://rversions.r-pkg.org/r-release")[[1]][['version']]
[1] "3.2.0"

      

+3


source


Another potential alternative: CRAN has a version information dcf file. I'm not sure how reliably it updates.



R> tmp <- tempfile()
R> download.file("http://cran.r-project.org/src/base/VERSION-INFO.dcf", tmp)
R> (x <- read.dcf(tmp))
     Release Old-release Devel  
[1,] "3.2.0" "3.1.3"     "3.3.0"

      

+4


source


There is a new isa rversions package from Gabor that makes maintenance even easier:

R> library(rversions)
R> r_release()
   version                        date
94   3.2.0 2015-04-16T07:13:33.144514Z
R> 
R> r_release()[[1]]
[1] "3.2.0"
R> 

      

If you have devtools installed , you probably already have rversions .

There are two more functions in the package to get

  • previous release through r_oldrel()

    as well
  • vector of all issues through r_versions()

+3


source







All Articles