title: pair-wise duplicate removal from dataframe
body: <p>This seems like a simple problem but I can't seem to figure it out. I'd like to remove duplicates from a dataframe (df) if two columns have the same values, even if those values are in the <strong>reverse order</strong>. What I mean is, say you have the following data frame:</p>
  
  <pre><code>a &lt;- c(rep("A", 3), rep("B", 3), rep("C",2))
  b &lt;- c('A','B','B','C','A','A','B','B')
  df &lt;-data.frame(a,b)
  
    a b
  1 A A
  2 A B
  3 A B
  4 B C
  5 B A
  6 B A
  7 C B
  8 C B
  </code></pre>
  
  <p>If I now remove duplicates, I get the following data frame:    </p>
  
  <pre><code>df[duplicated(df),]
  
    a b
  3 A B
  6 B A
  8 C B
  </code></pre>
  
  <p>However, I would also like to remove the row 6 in this data frame, since "A", "B" is the same as "B", "A". How can I do this automatically?</p>
  
  <p>Ideally I could specify which two columns to compare since the data frames could have varying columns and can be quite large.</p>
  
  <p>Thanks!</p>