title: Determining overlap and subsets of multiple data frames in R
body: <p>I have six different sets of data, each of which are data frames that are about 10,000 rows or larger and have two columns. One column contains peak names, such as "peak_1", the other the frequency. Some of these data frames contain the same peaks, and some dont. My goal is to find out which peaks are in which overlapping subsets of these six dataframes (there are 63 different possible combinations with 6 datasets). I found packages that could find out venn diagram subsets (which is what i am looking for), but not for 6 datasets, and i have tried using <code>%in%</code> and <code>which</code>, but with the size of my datasets i was hitting roadblocks that i couldnt figure out. I tried to determine it by hand by merging the files into all possible combinations then calculating the size of each subset by hand from the size of the files, but i seem to have take missteps there and i need to know what is contained in each subset, and not just the size.</p>
  
  <p>Example:</p>
  
  <pre><code>dataA             dataB            dataC
  V1      V2        V1       V2      V1       V2
  peak1   3         peak2    1       peak1    1
  peak2   1         peak3    2       peak4    3
  peak5   2         peak4    1       peak6    1
  peak8   1         peak8    2       peak8    4
  peak9   2
  </code></pre>
  
  <p>This is the result i am hoping to achieve, where dataX is a different dataframe (or something similar... i need to at least have new tables i can save as files)</p>
  
  <pre><code>dataA       dataB       dataC      dataAB      dataAC      dataBC      dataABC   
  V1    V2    V1    V2    V1    V2   V1     V2   V1     V2   V1    V2    V1    V2
  peak5 2     peak3 2     peak6 1    peak2  2    peak1  4    peak4 4     peak8 7
  peak9 2
  </code></pre>
  
  <p>I know this was long-winded, but any suggestions will be welcomed, as it seems like something that should be much more straight-forward than i am making it! </p>