title: How I can select rows from a dataframe that do not match?
body: <p>I'm trying to identify the values in a data frame that do not match, but can't figure out how to do this.</p>
  
  <pre><code># make data frame 
  a &lt;- data.frame( x =  c(1,2,3,4)) 
  b &lt;- data.frame( y =  c(1,2,3,4,5,6))
  
  # select only values from b that are not in 'a'
  # attempt 1: 
  results1 &lt;- b$y[ !a$x ]
  
  # attempt 2:  
  results2 &lt;- b[b$y != a$x,]
  </code></pre>
  
  <p>If <code>a = c(1,2,3)</code> this works, as <code>a</code> is a multiple of <code>b</code>. However, I'm trying to just select all the values from data frame <code>y</code>, that are not in <code>x</code>, and don't understand what function to use. </p>