title: R collapse duplicate pairs (in any order) across dataframe columns and edit 3rd column?
body: <p>I used rbind to join 2 dataframes, with a column denoting its source, resulting in</p>
  <pre><code>    from | to | source
  1     A    B      X    
  2     C    D      Y
  3     B    A      Y
  ...
  </code></pre>
  <p>I would like to look for overlapping pairs, regardless of &quot;order&quot;, combine those pairs, then edit the source column to something else, e.g. &quot;Z&quot;.</p>
  <p>In the above example, rows 1 and 3 would be flagged as overlapping, so they will be combined and modified.</p>
  <p>So the desired output would look something like</p>
  <pre><code>    from | to | source
  1     A    B      Z    
  2     C    D      Y
  ...
  </code></pre>
  <p>How can this be done?</p>