In R, you can determine the version of a particular package and use the relational operators on it with packageVersion() . For instance:
packageVersion("MASS") (pp <- packageVersion("MASS"))
How to get the equivalent form of version information for the current copy of R itself?
To answer this question, you need to determine exactly where to look, which is not as simple as it seems: for example
grep("R[._vV]",apropos("version"),value=TRUE) ## [1] ".ess.ESSRversion" ".ess.Rversion" "getRversion" ## "R_system_version" ## [5] "R.Version" "R.version" "R.version.string"
I ask this because I'm upset that I need to sort it out every few months ... I will answer if no one does this. Extra credit to find out the difference between packageVersion() and package_version() ...
I think that this question will be answered here , but the focus of my question will be specifically how to get information in a program form (i.e. not only how to find out which version works, but also how to get it in a form suitable to run automatic version tests inside R).
source share