title: Duplicate rows based on field in R
body: <p>I have a data frame <code>df</code> with a fields <code>count</code> and <code>value</code> and want to transform it to a data frame with the column <code>value</code> where each value of <code>value</code> is repeated <code>count</code> times.</p>
  
  <p>I actually don't have an idea how to do this other than in a loop. Solutions involving <code>plyr</code> or <code>reshape2</code> (or both) are perfectly acceptable.</p>
  
  <p>Here is an example of what I am looking for:</p>
  
  <pre><code>count value
  2     10
  1     20
  </code></pre>
  
  <p>to</p>
  
  <pre><code>value
  10
  10
  20
  </code></pre>
  
  <p><strong>Follow-up question</strong></p>
  
  <p>What if I had 3 fields <code>value1, value2, value3</code> which had to be repeated based on <code>count</code>?</p>