title: expand frequency table in r
body: <p>Hi everyone I am struggling with something that I think should be easy. </p>
  
  <p>I have a dataset that looks as follows </p>
  
  <pre><code>Var1 Var2 Var3 Var4 Count
   a    b    c     d    10
   z    a    c     f    3
  </code></pre>
  
  <p>I just need a function that replicates the rows based on the count. So I would end up with a new data frame or data table that would have 13 rows.</p>
  
  <p>I am trying to use the <code>rep()</code> function to do this, but it isn't working.</p>
  
  <pre><code>dat &lt;- read.table(text="Var1 Var2 Var3 Var4 Count
   a    b    c     d    10
   z    a    c     f    3", header=TRUE)
  </code></pre>