EVOLUTION-MANAGER
Edit File: isR.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: Are we using R, rather than S?</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 is.R {base}"><tr><td>is.R {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Are we using R, rather than S?</h2> <h3>Description</h3> <p>Test if running under <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>. </p> <h3>Usage</h3> <pre> is.R() </pre> <h3>Details</h3> <p>The function has been written such as to correctly run in all versions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span>, S and S-PLUS. In order for code to be runnable in both <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> and S dialects previous to S-PLUS 8.0, your code must either define <code>is.R</code> or use it as </p> <p><code>if (exists("is.R") && is.function(is.R) && is.R()) {</code><br /> <em>## R-specific code</em><br /> <code>} else {</code><br /> <em>## S-version of code</em><br /> <code>}</code> </p> <h3>Value</h3> <p><code>is.R</code> returns <code>TRUE</code> if we are using <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> and <code>FALSE</code> otherwise. </p> <h3>See Also</h3> <p><code><a href="Version.html">R.version</a></code>, <code><a href="system.html">system</a></code>.</p> <h3>Examples</h3> <pre> x <- stats::runif(20); small <- x < 0.4 ## In the early years of R, 'which()' only existed in R: if(is.R()) which(small) else seq(along = small)[small] </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>