title: assign unique group to identical rows
body: <p>This is a simplified version of the dataframe I have: </p>
  
  <pre><code>structure(list(a = structure(c(1L, 1L, 1L), .Label = "A", class = "factor"), 
      b = structure(c(2L, 2L, 1L), .Label = c("A", "B"), class = "factor"), 
      c = structure(c(1L, 1L, 1L), .Label = "A", class = "factor")), .Names = c("a", 
  "b", "c"), row.names = c("id1", "id2", "id3"), class = "data.frame")
  </code></pre>
  
  <p>In this df, the row.names are the unique IDs (I know it breaks the rules of tidy data). </p>
  
  <p>In the example, we can see that row id1 and rowid2 are duplicates. </p>
  
  <p>What I want to do is identify that they are duplicates, and assign a unique group name to those duplicates. Please note however, there will be multiple rows that are duplicates to each to other. </p>
  
  <p>My desired output would be: </p>
  
  <pre><code>ID_NAME  A B C GROUP
  row_id1  A B A   1
  row_id2  A B A   1
  row_id3  A A A   2
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Edit: </p>
  
  <p>Sample of my original data: </p>
  
  <pre><code>dput(head(temp))
  structure(list(name = c("3 - ПЛАСТ  ДОО   С.МУРТИНО  Друштво за производство,трговија и услуги увоз-извоз", 
  "FABRIKA ZA OPREMA I DELOVI FOD DOOEL NOVACI AD ELEM SKOPJE", 
  "Tрговско друштво за трговија на големо и мало и превоз СЕЈ-ПРОМ  Охрид ДОО", 
  "АВТ ИНТЕРНАТИОНАЛ ДОО СКОПЈЕ   Друштво за производство,трговија и услуги", 
  "АГНЕСА  ДООЕЛ  БИТОЛА Друштво за производство услуги и трговија на големо и мало", 
  "АГРАР ТРЕЈД ДООЕЛ Велес"), h_interni_procent = c(0.02, 0.01, 
  NA, NA, NA, 0.015), h_interni_iznos_od = c(NA_real_, NA_real_, 
  NA_real_, NA_real_, NA_real_, NA_real_), h_interni_iznos_do = c(NA_real_, 
  NA_real_, NA_real_, NA_real_, NA_real_, NA_real_), h_interni_min_iznos = c(12, 
  10, 10, 6, 10, 10), h_internet_pp53_min_iznos = c(NA, NA, 2, 
  NA, NA, NA), h_kibs_procent = c(0.015, 0.015, 0.015, NA, NA, 
  0.015)), .Names = c("name", "h_interni_procent", "h_interni_iznos_od", 
  "h_interni_iznos_do", "h_interni_min_iznos", "h_internet_pp53_min_iznos", 
  "h_kibs_procent"), class = c("data.table", "data.frame"), row.names = c(NA, 
  -6L), .internal.selfref = &lt;pointer: 0x0000000000220788&gt;)
  </code></pre>