title: Opposite of 'summarise' in dplyr: turn one row into many
body: <p>Is there functionality in <code>dplyr</code>that does the opposite of <code>summarise</code>, i.e., turn one row into many rows?</p>
  
  <p>Let us consider a data.frame that looks as follows:</p>
  
  <pre><code>&gt; testdf &lt;- data.frame(a=c(1,1,2,2), b=c(1,2,1,2))
  &gt; testdf &lt;- data.frame(a1=c(1,1,2,2), a2=c(1,2,1,2))
  &gt; testdf$a3 &lt;- replicate(4, rnorm(3), simplify = F)
  &gt; testdf
    a1 a2                                a3
  1  1  1 -0.6264538, 0.1836433, -0.8356286
  2  1  2  1.5952808, 0.3295078, -0.8204684
  3  2  1   0.4874291, 0.7383247, 0.5757814
  4  2  2  -0.3053884, 1.5117812, 0.3898432
  </code></pre>
  
  <p>I now would like to turn this into a data.frame with 4*3=12 rows, where each value in each cell would be atomic. In other words, I would like to expand on the column a3. The result should look like this:</p>
  
  <pre><code>&gt; resdf
     a1 a2         a3
  1   1  1 -0.6264538
  2   1  1  0.1836433
  3   1  1 -0.8356286
  4   1  2  1.5952808
  5   1  2  0.3295078
  6   1  2 -0.8204684
  7   2  1  0.4874291
  8   2  1  0.7383247
  9   2  1  0.5757814
  10  2  2 -0.3053884
  11  2  2  1.5117812
  12  2  2  0.3898432
  </code></pre>
  
  <p>Note that data.frames similar to the one shown above can arise in many situations, e.g. when working with a lot of data (for reasons of memory efficiency). Similar functionality was asked for in <a href="https://stackoverflow.com/questions/21739512/flattening-a-delimited-composite-column/21742105#21742105">this question</a>.</p>
  
  <p>I know there are solutions that do not employ<code>dplyr</code>, but I am interested in using it since I'd like to do this for grouped (<code>group_by(a2)</code>) subsets of data.</p>