EVOLUTION-MANAGER
Edit File: Platform.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Platform Specific Variables</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for .Platform {base}"><tr><td>.Platform {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Platform Specific Variables</h2> <h3>Description</h3> <p><code>.Platform</code> is a list with some details of the platform under which <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> was built. This provides means to write OS-portable <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> code. </p> <h3>Usage</h3> <pre> .Platform </pre> <h3>Value</h3> <p>A list with at least the following components: </p> <table summary="R valueblock"> <tr valign="top"><td><code>OS.type</code></td> <td> <p>character string, giving the <b>O</b>perating <b>S</b>ystem (family) of the computer. One of <code>"unix"</code> or <code>"windows"</code>. </p> </td></tr> <tr valign="top"><td><code>file.sep</code></td> <td> <p>character string, giving the <b>file</b> <b>sep</b>arator used on your platform: <code>"/"</code> on both Unix-alikes <em>and</em> on Windows (but not on the former port to Classic Mac OS). </p> </td></tr> <tr valign="top"><td><code>dynlib.ext</code></td> <td> <p>character string, giving the file name <b>ext</b>ension of <b>dyn</b>amically loadable <b>lib</b>raries, e.g., <code>".dll"</code> on Windows and <code>".so"</code> or <code>".sl"</code> on Unix-alikes. (Note for macOS users: these are shared objects as loaded by <code><a href="dynload.html">dyn.load</a></code> and not dylibs: see <code><a href="dynload.html">dyn.load</a></code>.) </p> </td></tr> <tr valign="top"><td><code>GUI</code></td> <td> <p>character string, giving the type of GUI in use, or <code>"unknown"</code> if no GUI can be assumed. Possible values are for Unix-alikes the values given via the <span class="option">-g</span> command-line flag (<code>"X11"</code>, <code>"Tk"</code>), <code>"AQUA"</code> (running under <code>R.app</code> on macOS), <code>"Rgui"</code> and <code>"RTerm"</code> (Windows) and perhaps others under alternative front-ends or embedded <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> </td></tr> <tr valign="top"><td><code>endian</code></td> <td> <p>character string, <code>"big"</code> or <code>"little"</code>, giving the ‘endianness’ of the processor in use. This is relevant when it is necessary to know the order to read/write bytes of e.g. an integer or double from/to a <a href="connections.html">connection</a>: see <code><a href="readBin.html">readBin</a></code>. </p> </td></tr> <tr valign="top"><td><code>pkgType</code></td> <td> <p>character string, the preferred setting for <code><a href="options.html">options</a>("pkgType")</code>. Values <code>"source"</code>, <code>"mac.binary.el-capitan"</code> and <code>"win.binary"</code> are currently in use. </p> <p>This should <strong>not</strong> be used to identify the OS. </p> </td></tr> <tr valign="top"><td><code>path.sep</code></td> <td> <p>character string, giving the <b>path</b> <b>sep</b>arator, used on your platform, e.g., <code>":"</code> on Unix-alikes and <code>";"</code> on Windows. Used to separate paths in environment variables such as <code>PATH</code> and <code>TEXINPUTS</code>. </p> </td></tr> <tr valign="top"><td><code>r_arch</code></td> <td> <p>character string, possibly <code>""</code>. The name of an architecture-specific directory used in this build of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> </td></tr> </table> <h3>AQUA</h3> <p><code>.Platform$GUI</code> is set to <code>"AQUA"</code> under the macOS GUI, <code>R.app</code>. This has a number of consequences: </p> <ul> <li> <p>‘<span class="file">/usr/local/bin</span>’ is <em>appended</em> to the <span class="env">PATH</span> environment variable. </p> </li> <li><p> the default graphics device is set to <code>quartz</code>. </p> </li> <li><p> selects native (rather than Tk) widgets for the <code>graphics = TRUE</code> options of <code><a href="../../utils/html/menu.html">menu</a></code> and <code><a href="../../utils/html/select.list.html">select.list</a></code>. </p> </li> <li><p> HTML help is displayed in the internal browser. </p> </li> <li><p> the spreadsheet-like data editor/viewer uses a Quartz version rather than the X11 one. </p> </li></ul> <h3>See Also</h3> <p><code><a href="Version.html">R.version</a></code> and <code><a href="Sys.info.html">Sys.info</a></code> give more details about the OS. In particular, <code>R.version$platform</code> is the canonical name of the platform under which <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> was compiled. </p> <p><code><a href="zMachine.html">.Machine</a></code> for details of the arithmetic used, and <code><a href="system.html">system</a></code> for invoking platform-specific system commands. </p> <p><code><a href="capabilities.html">capabilities</a></code> and <code><a href="extSoftVersion.html">extSoftVersion</a></code> (and links there) for availability of capabilities partly <em>external</em> to <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> but used from <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> functions. </p> <h3>Examples</h3> <pre> ## Note: this can be done in a system-independent way by dir.exists() if(.Platform$OS.type == "unix") { system.test <- function(...) system(paste("test", ...)) == 0L dir.exists2 <- function(dir) sapply(dir, function(d) system.test("-d", d)) dir.exists2(c(R.home(), "/tmp", "~", "/NO")) # > T T T F } </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>