Sys.info
Extract System and User Information

Description

Extracts information about the system and user.

Usage

Sys.info()

Details

The value of Sys.info()[["sysname"]] can be used in scripts to distinguish between Linux, Windows, and Mac.
Value
returns a named character vector with with the following elements:
sysname the type of system. Can be either "Linux", "Windows", or "Darwin".
release the release string for the operation system. The value is platform-dependent.
version the version string for the operating system.
nodename the node name for the system.
machine the type of machine (for example, "x86_64").
login the login used for the session.
user the user name for the session.
effective_user the effective user name for the session.
See Also
.Platform, R.version
Examples
Sys.info()
if(Sys.info()[["sysname"]] == "Linux") {
  # Do something only on Linux
}
Package base version 6.1.4-13
Package Index