title: How to reshape a data frame with multiple values for each id? (like pivot table in excel)
body: <p>I have this data frame:</p>
  
  <pre><code>data &lt;- data.frame(id=sample(1:10,2000,replace = T),value=sample(100:10000,2000,replace = T))
  &gt; head(data)
    id value
  1  4  2032
  2  3  2512
  3  9  8925
  4  8  8527
  5  6  5176
  6  9  8182
  </code></pre>
  
  <p>Now I want <code>value</code> for each <code>id</code> as <code>colnames</code> and the values are to be rows that correspond to the id.</p>
  
  <p>What I want is not to summarise but to group the values according to <code>id</code> and need to convert the <code>id</code> into columns.</p>