title: Finding similar column values in different dataframes, then creating a new dataframe
body: <p>Questions similar to this one have been asked before, but solutions to those questions didn't quite work for my purposes. Suppose I have two different dataframes:</p>
  <pre><code>A &lt;- c(&quot;Gene1&quot;, &quot;Gene3&quot;, &quot;Gene4&quot;, &quot;Gene9&quot;)
  B &lt;- c(-10, -4, 4, 19)
  df1 &lt;- data.frame(A, B)
  head(df1)
  
        A   B
  1 Gene1 -10
  2 Gene3  -4
  3 Gene4   4
  4 Gene9  19
  
  A &lt;- c(&quot;Gene3&quot;, &quot;Gene4&quot;, &quot;Gene7&quot;, &quot;Gene9&quot;)
  B &lt;- c(5, 2, 9, 11)
  df2 &lt;- data.frame(A, B)
  head(df2)
  
        A  B
  1 Gene3  5
  2 Gene4  2
  3 Gene7  9
  4 Gene9 11
  
  </code></pre>
  <p>Now I would like to create a new dataframe containing values for Column A that both df1 and df2 have similar (such as Gene3, Gene4 and Gene9), as well as BOTH values for the B column from df1 and df2, like so:</p>
  <pre><code>A &lt;- c(&quot;Gene3&quot;, &quot;Gene4&quot;, &quot;Gene9&quot;)
  B_df1 &lt;- c(-4, 4, 19)
  B_df2 &lt;- c(5, 2, 11)
  dfcombo &lt;- data.frame(A, B_df1, B_df2)
  head(dfcombo)
  
        A B_df1 B_df2
  1 Gene3    -4     5
  2 Gene4     4     2
  3 Gene9    19    11
  </code></pre>
  <p>Then I would also like a another dataframe containing only the rows that have unique values for column A for df1, and one that only contains the rows with a unique column A value for df2.</p>
  <pre><code>#the final printout for this example should look like this:
  head(df1_unique)
  
        A   B
  1 Gene1 -10
  
  head(df2_unique)
  
        A B
  1 Gene7 9
  </code></pre>
  <p>So in the end I should end up with 3 dataframes. Thanks!</p>