[R] a reliable way to check the latest version of R on CRAN?

Yihui Xie xie at yihui.name
Thu Sep 16 18:29:05 CEST 2010


Hi all,

We know old.packages() can check for updates of add-on packages, but
is there a way to check updates of R itself? "go to R homepage" is a
way, of course, but I hope this can be done by R.

I'm not sure about the "reliable" place to check; here is a simple
example to check from one of the CRAN webpages (kind of nasty
approach...):

x = readLines("http://cran.r-project.org/sources.html")
# the version number is in the next line of 'The latest release'
rls = x[grep("latest release", x) + 1L]
newver = gsub("(.*R-|\\.tar\\.gz.*)", "", rls)
oldver = paste(getRversion(), collapse = ".")
# new version available?
compareVersion(newver, oldver) == 1L

Thanks!

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



More information about the R-help mailing list