title: Duplicating data frame rows by freq value in same data frame
body: <p>I have a data frame with names by type and their frequencies.  I'd like to expand this data frame so that the names are repeated according to their name-type frequency.
  For example, this:</p>
  
  <pre><code>&gt; df = data.frame(name=c('a','b','c'),type=c(0,1,2),freq=c(2,3,2))
  name type freq
  1    a    0    2
  2    b    1    3
  3    c    2    2
  </code></pre>
  
  <p>would become this:</p>
  
  <pre><code>&gt; df_exp
  name type
  1    a    0
  2    a    0
  3    b    1
  4    b    1
  5    b    1
  6    c    2
  7    c    2
  </code></pre>
  
  <p>Appreciate any suggestions on a easy way to do this.</p>