title: Duplicating R dataframe vector values using another vector as a guide
body: <p>I have the following R dataframe: <code>df = data.frame(value=c(5,4,3,2,1), a=c(2,0,1,6,9), b=c(7,0,0,3,4))</code>. I would like to duplicate the values of <code>a</code> and <code>b</code> by the number of times of the corresponding position values in <code>value</code>. For example, Expanding <code>b</code> would look like <code>b_ex = c(7,7,7,7,7,2,2,2,4)</code>. No values of three or four would be in <code>b_ex</code> because values of zero are in <code>b[2]</code> and <code>b[3]</code>. The expanded vectors would be assigned names and be stand-alone.</p>
  <p>Thanks!</p>