title: Resizing a R dataframe on the base of the column content
body: <p>I have a rather big dataframe structured in the following way:</p>
  <pre><code>     Date         Item size       
  [1,] &quot;2021-01-04&quot; &quot;AA&quot; &quot;23.25&quot;    
  [2,] &quot;2021-01-05&quot; &quot;AA&quot; &quot;23.67&quot;    
  [3,] &quot;2021-01-06&quot; &quot;AA&quot; &quot;25.20&quot;
  [4,] &quot;2021-01-04&quot; &quot;BB&quot; &quot;31.21&quot;    
  [5,] &quot;2021-01-05&quot; &quot;BB&quot; &quot;33.27&quot;    
  [6,] &quot;2021-01-06&quot; &quot;BB&quot; &quot;35.20&quot;
  [7,] &quot;2021-01-04&quot; &quot;CC&quot; &quot;13.25&quot;    
  [8,] &quot;2021-01-05&quot; &quot;CC&quot; &quot;13.61&quot;    
  [9,] &quot;2021-01-06&quot; &quot;CC&quot; &quot;15.20&quot;
  </code></pre>
  <p>etc.</p>
  <p>I would like it to be reformat in the following way:</p>
  <pre><code>     Date         AA        BB      CC      
  [1,] &quot;2021-01-04&quot; &quot;23.25&quot;   &quot;31.21&quot; &quot;13.25&quot;     
  [2,] &quot;2021-01-05&quot; &quot;23.67&quot;   &quot;33.27&quot; &quot;13.61&quot; 
  [3,] &quot;2021-01-06&quot; &quot;25.20&quot;   &quot;35.20&quot; &quot;15.20&quot; 
  </code></pre>
  <p>Therefore, for all the different occurrences in the 'Item' column (&quot;AA&quot;,&quot;BB&quot;,&quot;CC&quot;), a new column should be created with that name and carrying all the values reported in the 'size' column for that Item. The number of the different occurrences in the 'Item' column is always the same  (three &quot;AA&quot;, three &quot;BB&quot;, three &quot;CC&quot;).
  As mentioned, my dataframe is rather big (millions of lines), but I used this representative example for the sake of seplicity.
  Any help or pointer would be greatly appreciated.</p>