title: How to extend `==` behavior to vectors that include NAs?
body: <p>I've completely failed at searching for other r-help or Stack&nbsp;Overflow discussion of this specific issue. Sorry if it's somewhere obvious. I believe that I'm just looking for the easiest way to get R's == sign to never return NAs.</p>
  
  <pre><code># Example #
  
  # Say I have two vectors
  a &lt;- c( 1 , 2 , 3 )
  b &lt;- c( 1 , 2 , 4 )
  # And want to test if each element in the first
  # is identical to each element in the second:
  a == b
  # It does what I want perfectly:
  # TRUE TRUE FALSE
  
  # But if either vector contains a missing,
  # the `==` operator returns an incorrect result:
  a &lt;- c( 1 , NA , 3 ) 
  b &lt;- c( 1 , NA , 4 )
  # Here I'd want   TRUE TRUE FALSE
  a == b
  # But I get TRUE NA FALSE
  
  a &lt;- c( 1 , NA , 3 ) 
  b &lt;- c( 1 , 2 , 4 )
  # Here I'd want   TRUE FALSE FALSE
  a == b
  # But I get TRUE NA FALSE again.
  </code></pre>
  
  <p>I get the result I want with:</p>
  
  <pre><code>mapply( `%in%` , a , b )
  </code></pre>
  
  <p>But <code>mapply</code> seems heavy-handed to me.</p>
  
  <p>Is there a more intuitive solution to this?</p>