title: Create specified number of observations per ID
body: <p>I have a dataset with specified number of records per person:</p>
  
  <pre><code>set.seed(99)
  # Create values from a Poisson distribution
  freqs &lt;- rpois(100, 3) 
  # Add an ID to each row
  freqs &lt;- as.data.frame(freqs)
  freqs$id &lt;- seq_len(nrow(freqs))
  </code></pre>
  
  <p>I now want the value in the <code>freqs$freqs</code> to be the number of observations per each ID. The transformation would look like:</p>
  
  <pre><code>ID    freqs
  1      3
  2      1
  ...    ...
  3      2
  </code></pre>
  
  <p>Ending up with:</p>
  
  <pre><code>ID    freqs
  1      3
  1      3
  1      3
  2      1
  ...    ....
  3      2
  3      2
  </code></pre>