title: tidyr spread does not aggregate data
body: <p>I have data of the following:</p>
  
  <pre><code>    &gt; data &lt;- data.frame(unique=1:9, grouping=rep(c('a', 'b', 'c'), each=3), value=sample(1:30, 9))
      &gt; data
        unique grouping value
      1      1        a    15
      2      2        a    21
      3      3        a    26
      4      4        b     8
      5      5        b     6
      6      6        b     4
      7      7        c    17
      8      8        c     1
      9      9        c     3
  </code></pre>
  
  <p>I would like to create a table that looks like this:</p>
  
  <pre><code>       a        b    c
  1      15       8    17
  2      21       6    1
  3      26       6    3
  </code></pre>
  
  <p>I am using tidyr::spread and not getting the correct result:</p>
  
  <pre><code>&gt; data %&gt;% spread(grouping, value)
    unique  a  b  c
  1      1 15 NA NA
  2      2 21 NA NA
  3      3 26 NA NA
  4      4 NA  8 NA
  5      5 NA  6 NA
  6      6 NA  4 NA
  7      7 NA NA 17
  8      8 NA NA  1
  9      9 NA NA  3
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>&gt; data %&gt;% select(grouping, value) %&gt;% spread(grouping, value)
  Error: Duplicate identifiers for rows (1, 2, 3), (4, 5, 6), (7, 8, 9)
  </code></pre>
  
  <p>Is there a way to do this also when one group (c) has a different length than the others?</p>