title: How to find row indices where duplicated pairs exist
body: <p>I have a list of data.frames, each data.frame is a separate output of the same format. I can merge all of them into a master list with </p>
  
  <pre><code>master &lt;- do.call("rbind", list)
  </code></pre>
  
  <p>I have two columns in particular (1 and 3) in which I want to find duplicates, which I do so with</p>
  
  <pre><code>unique.pairs &lt;- unique(master[duplicated(master[,c(1,3)]),c(1,3)])
  </code></pre>
  
  <p>This will give me a data.frame of unique column 1, 3 pairings.</p>
  
  <p>Now I want to find, for each unique pair, where are the other instances of this pair. The ideal output would be a data.frame with one column containing the pairing (can concatenate the string to one) and another containing the row names from master (easily obtainable with the index of duplicates I'm trying to find) where the duplicate exists</p>
  
  <p>A dummy example (stripped down to the two columns of interest):</p>
  
  <pre><code>master &lt;- data.frame(A=c(1,1,2,2,3,3,4,4,5,5), B=c(1,2,3,3,4,5,6,6,7,8))
  unique.pairs &lt;- unique(master[duplicated(master,c(1,2)]),c(1,2)])
  </code></pre>
  
  <p>Now I want to be able to make a data.frame as such:</p>
  
  <pre><code>results &lt;- data.frame(instance=c("2-&gt;3","4-&gt;6"), indices=c("3,4","7,8"))
  </code></pre>
  
  <p>I am thinking you iterate through each pair of <code>unique.pairs</code> then find where that pair exists in <code>master</code>, but I can't figure out the syntax.</p>