ID EN
System & OS

R.Version

R Base 3.6.2

R.Version() provides detailed information about the version of R running. R.version is a variable (a list) holding this information (and version is a copy of it for S compatibility).

Syntax

R
R.Version()
R.version
R.version.string
version

Return Value

R.Version returns a list with character-string components platformthe platform for which R was built. A triplet of the form CPU-VENDOR-OS, as determined by the configure script. E.g, "i686-unknown-linux-gnu" or "i386-pc-mingw32". archthe architecture (CPU) R was built on/for. osthe underlying operating system. systemCPU and OS, separated by a comma. statusthe status of the version (e.g., "alpha") majorthe major version number minorthe minor version number, including the patchlevel yearthe year t

Details

This gives details of the OS under which R was built, not the one under which it is currently running (for which see Sys.info). Note that OS names might not be what you expect: for example macOS Mavericks 10.9.4 identifies itself as darwin13.3.0, Linux usually as linux-gnu and Solaris 10 as solaris2.10.

Examples

Example
R
# NOT RUN {
require(graphics)

R.version$os # to check how lucky you are ...
plot(0) # any plot
mtext(R.version.string, side = 1, line = 4, adj = 1) # a useful bottom-right note

## a good way to detect macOS:
if(grepl("^darwin", R.version$os)) message("running on macOS")

## Short R version string, ("space free", useful in file/directory names;
##                          also fine for unreleased versions of R):
shortRversion <- function() {
   rvs <- R.version.string
   if(grepl("devel", (st <- R.version$status)))
       rvs <- sub(paste0(" ",st," "), "-devel_", rvs, fixed=TRUE)
   gsub("[()]", "", gsub(" ", "_", sub(" version ", "-", rvs)))
}
# }
# NOT RUN {
shortRversion()
# }

See Also

sessionInfo which provides additional information; getRversion typically used inside R code .Platform Sys.info.