title: Rename sequence of elements if it occurs more than once (R, dplyr)
body: <p>I have a dataset, df</p>
  
  <pre><code> ID         Date
   A          9/9/2019 5:00:01
   A          9/9/2019 5:00:02
   A          9/9/2019 5:00:03
   B          9/9/2019 6:00:01
   B          9/9/2019 6:00:03
   B          9/9/2019 6:00:04
   A          9/9/2019 6:00:05
   A          9/9/2019 6:00:06
   A          9/9/2019 6:00:07
   c          9/9/2019 6:00:08
   c          9/9/2019 6:00:09
   A          9/9/2019 6:00:10
   A          9/9/2019 6:00:11
  </code></pre>
  
  <p>I would like </p>
  
  <pre><code> ID         Date
   A          9/9/2019 5:00:01
   A          9/9/2019 5:00:02
   A          9/9/2019 5:00:03
   B          9/9/2019 6:00:01
   B          9/9/2019 6:00:03
   B          9/9/2019 6:00:04
   list1      9/9/2019 6:00:05
   list1      9/9/2019 6:00:06
   list1      9/9/2019 6:00:07
   c          9/9/2019 6:00:08
   c          9/9/2019 6:00:09
   list2      9/9/2019 6:00:10
   list2      9/9/2019 6:00:11
  </code></pre>
  
  <p>I would like to rename a sequence of elements if it occurs more than once in my dataset</p>
  
  <p><strong>dput:</strong></p>
  
  <pre><code>structure(list(ID = structure(c(1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 
  1L, 3L, 3L, 1L, 1L), .Label = c("A", "B", "c"), class =   "factor"), 
  Date = structure(1:13, .Label = c("9/9/2019 12:00:00 AM", 
  "9/9/2019 12:00:01 AM", "9/9/2019 12:00:02 AM", "9/9/2019    12:00:03 AM", 
  "9/9/2019 12:00:04 AM", "9/9/2019 12:00:05 AM", "9/9/2019   12:00:06 AM", 
  "9/9/2019 12:00:07 AM", "9/9/2019 12:00:08 AM", "9/9/2019 12:00:09 AM", 
  "9/9/2019 12:00:11 AM", "9/9/2019 12:00:12 AM", "9/9/2019 12:00:13 AM"
  ), class = "factor")), class = "data.frame", row.names = c(NA, 
  -13L))
  </code></pre>
  
  <p>This is what I have tried:</p>
  
  <pre><code>c(letters, do.call(paste0, expand.grid(letters, 1:1000)))
  setDT(df[, grp := rleid(ID)][ItemSubject == "", 
  ItemSubject := nm1[.GRP], grp][, grp := NULL][]
  </code></pre>
  
  <p>I was using this command prior, but not sure to integrate this particular command within the code.</p>