title: Transpose duplicated rows to column in R
body: <p>I have a large data.frame (20000+ entries) in this format:</p>
  
  <pre><code>id  D1      D2
  1   0.40    0.21
  1   0.00    0.00
  1   0.53    0.20
  2   0.17    0.17
  2   0.25    0.25
  2   0.55    0.43
  </code></pre>
  
  <p>Where each id may be duplicated 3-20 times. I would like to merge the duplicated rows into new columns, so my new data.frame looks like:</p>
  
  <pre><code>id  D1      D2      D3      D4      D5      D6
  1   0.40    0.21    0.00    0.00    0.53    0.20
  2   0.17    0.17    0.25    0.25    0.55    0.43
  </code></pre>
  
  <p>I've manipulated data.frames before with plyr, but I'm not sure how to approach this problem. Any help would be appreciated.Thanks.</p>