EVOLUTION-MANAGER
Edit File: logical.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: Logical Vectors</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 logical {base}"><tr><td>logical {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Logical Vectors</h2> <h3>Description</h3> <p>Create or test for objects of type <code>"logical"</code>, and the basic logical constants. </p> <h3>Usage</h3> <pre> TRUE FALSE T; F logical(length = 0) as.logical(x, ...) is.logical(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>length</code></td> <td> <p>A non-negative integer specifying the desired length. Double values will be coerced to integer: supplying an argument of length other than one is an error.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>object to be coerced or tested.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p><code>TRUE</code> and <code>FALSE</code> are <a href="Reserved.html">reserved</a> words denoting logical constants in the <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> language, whereas <code>T</code> and <code>F</code> are global variables whose initial values set to these. All four are <code>logical(1)</code> vectors. </p> <p>Logical vectors are coerced to integer vectors in contexts where a numerical value is required, with <code>TRUE</code> being mapped to <code>1L</code>, <code>FALSE</code> to <code>0L</code> and <code>NA</code> to <code>NA_integer_</code>. </p> <h3>Value</h3> <p><code>logical</code> creates a logical vector of the specified length. Each element of the vector is equal to <code>FALSE</code>. </p> <p><code>as.logical</code> attempts to coerce its argument to be of logical type. For <code><a href="factor.html">factor</a></code>s, this uses the <code><a href="levels.html">levels</a></code> (labels). Like <code><a href="vector.html">as.vector</a></code> it strips attributes including names. Character strings <code>c("T", "TRUE", "True", "true")</code> are regarded as true, <code>c("F", "FALSE", "False", "false")</code> as false, and all others as <code>NA</code>. </p> <p><code>is.logical</code> returns <code>TRUE</code> or <code>FALSE</code> depending on whether its argument is of logical type or not. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="NA.html">NA</a></code>, the other logical constant. </p> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>