To get the version of my R installation I use
R.Version()
and it produces a long output:
> R.Version()
$platform
[1] "x86_64-w64-mingw32"
$arch
[1] "x86_64"
# many more things
until I get the:
$version.string
[1] "R version 3.1.2 (2014-10-31)"
I also see the version as the first text from the R Console:
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
# many other things
However, I wonder: is there any way to get the exact version without getting the rest of info? That is, is there any way to just get this:
R version 3.1.2 (2014-10-31)
From within R:
R.version.string
## [1] "R version 3.1.0 (2014-04-10)"
From the command-line you can grep it out:
> R --version| grep -Eo 'R version [0-9.]+ \([0-9]{4}-[0-9]{2}-[0-9]{2}\)';
## R version 3.1.0 (2014-04-10)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With