title: Assigning groupid across shared common columns
body: <p>I have the following data.frame (in reality it's millions of records).</p>
  
  <p>I'd like to be able to assign a group id when a phone number matches across any other record and any phone number position.</p>
  
  <pre><code>id &lt;- c(1:5)
  phone_1 &lt;- c("444","", "333", "222", "")
  phone_2 &lt;- c("", "444", "111", "", "")
  phone_3 &lt;- c("222","", "", "", "111")
  df &lt;- data.frame(id, phone_1, phone_2, phone_3)
  </code></pre>
  
  <p>The ideal output would be the following:</p>
  
  <pre><code>print(df)
  #   id phone_1 phone_2 phone_3  ID
  # 1  1     444             222  1
  # 2  2             444          1
  # 3  3     333     111          2
  # 4  4     222                  1
  # 5  5                     111  2
  </code></pre>
  
  <p>Ideally, I would like to use a <code>data.table</code> method as speed is important.</p>
  
  <p>Note that missing values (<code>""</code> or <code>NA</code>) should be treated as incomparables (or all of the above would be in the same group).</p>