title: How to create a unique ID disambiguating strings in r?
body: <p>I have a large dataset with three variables (State, Zipcode, Name). Here a small extraction:</p>
  
  <pre><code>zz &lt;- "State Zipcode Name
  IL  60693 THISISTHEFIRST  
  IL 60693 TISISTHEFIRS    
  OH  45271 THISISTHEFIRST  
  CA 94085 THISISTHESECOND  
  CA 94085 THISISTHESECOND  
  CA 94085 THISISTHESECCOND 
  SC 29645 THISISTHETHIRD  
  SC 29645 THISISTHETHIRD  
  SC 29645 THISISTHETHIRD  
  SC 29645 THISISTHEFOURTH  
  SC 29645 ISISTHEFOURTH"
  
  Data &lt;- read.table(text=zz, header = TRUE)
  </code></pre>
  
  <p>I need to create a unique ID for observations characterized by the same State, Zipcode, Name. Some of the names are however misspelled even though they do actually represent the same subject (e.g. THISISTHEFIRST vs. TISISTHEFIRS)</p>
  
  <p>I would like to end up with something that looks like this:</p>
  
  <pre><code>State Zipcode Name ID
  IL 60693 THISISTHEFIRST 1
  IL 60693 TISISTHEFIRS 1
  OH 45271 THISISTHEFIRST 2
  CA 94085 THISISTHESECOND 3
  CA 94085 THISISTHESECOND 3
  CA 94085 THISISTHESECCOND 3
  WI 53022 THISISTHETHIRD 4
  WI 53022 THISISTHETHIRD 4
  WI 53022 THISISTHETHIRD 4
  SC 29645 THISISTHEFOURTH 5
  SC 29645 ISISTHEFOURTH 5
  </code></pre>
  
  <p>How could I create the unique ID in a fast and working way?</p>