title: How to remove duplicates based on the combinations of two columns
body: <p>I have a dataframe like below.</p>
  
  <pre><code>df = expand.grid(A = c('a', 'b', 'c', 'd'),
                  B = c('a', 'b', 'c', 'd'))
  
  
  A   B
  a   a           
  b   a           
  c   a           
  d   a           
  a   b           
  b   b           
  c   b           
  d   b           
  a   c           
  b   c
  </code></pre>
  
  <p>What I need to do is to remove duplicates based on COMBINATION of two column values. For example, when row1 is 'a', 'b' and row2 is 'b', 'a'. They are considered as duplicates. I need to remove one of them. Removing duplicates of two columns is easy. But in this case, how can I remove duplicates based on their combinations? I could not figure out how. Thanks a lot in advance.</p>