EVOLUTION-MANAGER
Edit File: all.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 All Values True?</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 all {base}"><tr><td>all {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Are All Values True?</h2> <h3>Description</h3> <p>Given a set of logical vectors, are all of the values true? </p> <h3>Usage</h3> <pre> all(..., na.rm = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>zero or more logical vectors. Other objects of zero length are ignored, and the rest are coerced to logical ignoring any class.</p> </td></tr> <tr valign="top"><td><code>na.rm</code></td> <td> <p>logical. If true <code>NA</code> values are removed before the result is computed.</p> </td></tr> </table> <h3>Details</h3> <p>This is a generic function: methods can be defined for it directly or via the <code><a href="groupGeneric.html">Summary</a></code> group generic. For this to work properly, the arguments <code>...</code> should be unnamed, and dispatch is on the first argument. </p> <p>Coercion of types other than integer (raw, double, complex, character, list) gives a warning as this is often unintentional. </p> <p>This is a <a href="Primitive.html">primitive</a> function. </p> <h3>Value</h3> <p>The value is a logical vector of length one. </p> <p>Let <code>x</code> denote the concatenation of all the logical vectors in <code>...</code> (after coercion), after removing <code>NA</code>s if requested by <code>na.rm = TRUE</code>. </p> <p>The value returned is <code>TRUE</code> if all of the values in <code>x</code> are <code>TRUE</code> (including if there are no values), and <code>FALSE</code> if at least one of the values in <code>x</code> is <code>FALSE</code>. Otherwise the value is <code>NA</code> (which can only occur if <code>na.rm = FALSE</code> and <code>...</code> contains no <code>FALSE</code> values and at least one <code>NA</code> value). </p> <h3>S4 methods</h3> <p>This is part of the S4 <code><a href="../../methods/html/S4groupGeneric.html">Summary</a></code> group generic. Methods for it must use the signature <code>x, ..., na.rm</code>. </p> <h3>Note</h3> <p>That <code>all(logical(0))</code> is true is a useful convention: it ensures that </p> <pre>all(all(x), all(y)) == all(x, y) </pre> <p>even if <code>x</code> has length zero. </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="any.html">any</a></code>, the ‘complement’ of <code>all</code>, and <code><a href="stopifnot.html">stopifnot</a>(*)</code> which is an <code>all(*)</code> ‘insurance’. </p> <h3>Examples</h3> <pre> range(x <- sort(round(stats::rnorm(10) - 1.2, 1))) if(all(x < 0)) cat("all x values are negative\n") all(logical(0)) # true, as all zero of the elements are true. </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>