[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  R.Version: Version Information

##  Description

` R.Version() ` provides detailed information about the version of  R
running.

` R.version ` is a variable (a ` [ list
](/link/list?package=base&version=3.6.2) ` ) holding this information (and `
version ` is a copy of it for S compatibility).

##  Usage

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

##  Arguments

##  Value

` R.Version ` returns a list with character-string components

platform

    

the 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" ` .

arch

    

the architecture (CPU)  R  was built on/for.

os

    

the underlying operating system.

system

    

CPU and OS, separated by a comma.

status

    

the status of the version (e.g., ` "alpha" ` )

major

    

the major version number

minor

    

the minor version number, including the patchlevel

year

    

the year the version was released

month

    

the month the version was released

day

    

the day the version was released

svn rev

    

the Subversion revision number, which should be either ` "unknown" ` or a
single number. (A range of numbers or a number with  M  or  S  appended
indicates inconsistencies in the sources used to build this version of  R  .)

language

    

always ` "R" ` .

version.string

    

a ` [ character ](/link/character?package=base&version=3.6.2) ` string
concatenating some of the info above, useful for plotting, etc.

R.version and version are lists of class "simple.list" which has a print
method.

##  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
](/link/Sys.info?package=base&version=3.6.2) ` ).

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  .

##  See Also

` [ sessionInfo ](/link/sessionInfo?package=base&version=3.6.2) ` which
provides additional information; ` [ getRversion
](/link/getRversion?package=base&version=3.6.2) ` typically used inside R
code, ` [ .Platform ](/link/.Platform?package=base&version=3.6.2) ` , ` [
Sys.info ](/link/Sys.info?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FR.Version&utm_source=r-docs&utm_medium=docs&utm_term=R.Version&utm_content=run_example_in_workspace)

    
    
    # 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()
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FR.Version&utm_source=r-docs&utm_medium=docs&utm_term=R.Version&utm_content=run_example_in_workspace)

Powered by  [ DataCamp ](https://www.datacamp.com/)