title: Unique and non-unique lists of values in a data frame in R
body: <p>Suppose I have two Data Frames:</p>
  
  <p>Data frame 1 (let's call this Data1):</p>
  
  <pre><code>V1     V2     
  1     "AB"    
  3     "XY"
  5     "DH"
  8     "ST"
  7     "RE"
  </code></pre>
  
  <p>code for Data1:</p>
  
  <pre><code>V1 &lt;- c(1,3,5,8,7)
  V2 &lt;- c("AB","XY", "DH", "ST","RE")
  Data1 &lt;- data.frame(V1,V2)
  </code></pre>
  
  <p>Data frame 2 (lets call this Data2):</p>
  
  <pre><code>V1     V2     
  1     "AB"    
  2     "ZZ"
  3     "XY"
  5     "DH"
  8     "ST" 
  </code></pre>
  
  <p>code for Data2:</p>
  
  <pre><code>V1 &lt;- c(1,2,3,5,8)
  V2 &lt;- c("AB","ZZ","XY","DH","ST")
  Data2 &lt;- data.frame(V1,V2)
  </code></pre>
  
  <p>If you notice, Data2's second row (where V2's value is "ZZ") is not present in Data1 AND the last row in Data1 (where V2's value is "RE") is not present in Data2. </p>
  
  <p><strong>A)</strong> I would like to make a list of all V2 values that are NOT present in either of the data frames.<br>
  <em>For this example that would be "ZZ" and "RE".</em></p>
  
  <p><strong>B)</strong> I would like to make a list of all V2 values that ARE present in both data frames.<br>
  <em>For this example, the result would be "AB", "XY", "DH", "ST".</em></p>