title: Assigning an unique identification variable across repeated values
body: <p>I will create a simple example of some dummy data:</p>
  
  <pre><code>case &lt;- c('a','a','a','b','b','c','c','c','c','d','d','e','e')
  object &lt;- c(1,1,2,1,1,1,1,2,3,1,1,1,2)
  
  df1 &lt;- data.frame(case, object)
  </code></pre>
  
  <p>Now for each unique <code>case</code> and <code>object</code> value, I want to create a corresponding unique numerical value (an identifier)</p>
  
  <pre><code>df1$UNIQ_ID &lt;- ........
  </code></pre>
  
  <p>The end result should take the following values <code>c(1,1,2,3,3,4,4,5,6,7,7,8,9)</code> as when</p>
  
  <pre><code>unique(df1$object[df1$case=='a'])
  unique(df1$object[df1$case=='b'])
  </code></pre>
  
  <p>I have though of using <code>dpylr</code> and <code>group_by(case)</code></p>