Learn R Programming

rstudioapi (version 0.17.0)

versionInfo: RStudio version information

Description

Query information about the currently running instance of RStudio.

Usage

versionInfo()

Arguments

Value

An R list with the following elements:

versionThe version of RStudio.
mode"desktop" for RStudio Desktop, or "server" for RStudio Server.
citationInformation on how RStudio can be cited in academic publications.

Examples

Run this code

if (FALSE) {
info <- rstudioapi::versionInfo()

# check what version of RStudio is in use
if (info$version >= "1.4") {
  # code specific to versions of RStudio 1.4 and newer
}

# check whether RStudio Desktop or RStudio Server is being used
if (info$mode == "desktop") {
  # code specific to RStudio Desktop
}

# Get the citation
info$citation

}

Run the code above in your browser using DataLab