title: Comparing character vectors in R to find unique and/or missing values
body: <p>I have two character vectors, x and y.</p>
  
  <pre><code>x &lt;- c("a", "b", "c", "d", "e", "f", "g")
  y &lt;- c("a",      "c", "d", "e",      "g")
  </code></pre>
  
  <p>The values inside x do not ever repeat (i.e., they are all unique). The same goes for vector y. My question is, how can I get R to compare the two vectors, and then tell me which elements are missing from y with respect to x? Otherwise stated, I want R to tell me that "b" and "f" are missing from y.</p>
  
  <p>(Note, in my real data, x and y each contain a few thousand observations, which is why I would like to do this programmatically. There is likely a very simple answer, but I wasn't sure what to search for in the R help files).</p>
  
  <p>Thanks to anyone who can help!</p>