EVOLUTION-MANAGER
Edit File: vec_compare.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: Compare two 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 vec_compare {vctrs}"><tr><td>vec_compare {vctrs}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compare two vectors</h2> <h3>Description</h3> <p>Compare two vectors </p> <h3>Usage</h3> <pre> vec_compare(x, y, na_equal = FALSE, .ptype = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, y</code></td> <td> <p>Vectors with compatible types and lengths.</p> </td></tr> <tr valign="top"><td><code>na_equal</code></td> <td> <p>Should <code>NA</code> values be considered equal?</p> </td></tr> <tr valign="top"><td><code>.ptype</code></td> <td> <p>Override to optionally specify common type</p> </td></tr> </table> <h3>Value</h3> <p>An integer vector with values -1 for <code>x < y</code>, 0 if <code>x == y</code>, and 1 if <code>x > y</code>. If <code>na_equal</code> is <code>FALSE</code>, the result will be <code>NA</code> if either <code>x</code> or <code>y</code> is <code>NA</code>. </p> <h3>S3 dispatch</h3> <p><code>vec_compare()</code> is not generic for performance; instead it uses <code><a href="vec_proxy_compare.html">vec_proxy_compare()</a></code> to create a proxy that is used in the comparison. </p> <h3>Dependencies</h3> <ul> <li> <p><code><a href="vec_cast.html">vec_cast_common()</a></code> with fallback </p> </li> <li> <p><code><a href="vec_recycle.html">vec_recycle_common()</a></code> </p> </li> <li> <p><code><a href="vec_proxy_compare.html">vec_proxy_compare()</a></code> </p> </li></ul> <h3>Examples</h3> <pre> vec_compare(c(TRUE, FALSE, NA), FALSE) vec_compare(c(TRUE, FALSE, NA), FALSE, na_equal = TRUE) vec_compare(1:10, 5) vec_compare(runif(10), 0.5) vec_compare(letters[1:10], "d") df <- data.frame(x = c(1, 1, 1, 2), y = c(0, 1, 2, 1)) vec_compare(df, data.frame(x = 1, y = 1)) </pre> <hr /><div style="text-align: center;">[Package <em>vctrs</em> version 0.5.0 <a href="00Index.html">Index</a>]</div> </body></html>