title: Difference between two vectors in R
body: <p>I have two vectors:</p>
  
  <pre><code>a &lt;- c(1, 1, 3, 4, 5, 7, 9)
  b &lt;- c(2, 3, 4, 6, 8, 2)
  </code></pre>
  
  <p>I want to find the numbers in the second vector, which are not in the  first vector:</p>
  
  <pre><code>dif &lt;- c(2, 6, 8)
  </code></pre>
  
  <p>I've tried many different approaches (such as merge, different types of joins (dplyr package), setdiff, compare (compare package)), but I still can't find a way to do it.</p>