Yihui Xie
2010-Sep-16 16:29 UTC
[R] a reliable way to check the latest version of R on CRAN?
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
Barry Rowlingson
2010-Sep-17 16:08 UTC
[R] a reliable way to check the latest version of R on CRAN?
On Thu, Sep 16, 2010 at 5:29 PM, Yihui Xie <xie at yihui.name> wrote:> 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...):checkRVersion in gtools does it by looking for the .tar.gz releases in CRAN:> library(gtools) > checkRVersion()A newer version of R is now available: 2.11.1 and then a bit later....> checkRVersion()The latest version of R is installed: 2.11.1 It returns the latest version and you can make it quiet for use in scripts. Barry