title: I want to convert one of my column values into multiple variables in R
body: <p>I have the data in below format </p>
  
  <pre><code>ID  ID_2    Item ID
  001 111 1111
  001 111 1112
  001 112 1113
  001 112 1114
  001 112 1115
  001 112 1116
  001 113 1117
  008 222 1118
  008 222 1119
  008 223 1120
  011 333 1121
  012 444 1122
  012 444 1123
  012 444 1124
  012 444 1125
  012 444 1126
  017 555 1127
  017 555 1128
  017 555 1129
  </code></pre>
  
  <p>but i want to convert item_ID into multiple variables based on the order they appear in ID_2 and ID_1.Somewhat like what i have mentioned below</p>
  
  <pre><code>ID  ID_2    Item_1  Item_2  Item_3  Item_4  Item_5
  001 111 1111    1112            
  001 112 1113    1114    1115    1116    
  001 113 1117                
  008 222 1118    1119            
  008 223 1120                
  011 333 1121                
  012 444 1122    1123    1124    1125    1126
  017 555 1127    1128    1129        
  </code></pre>
  
  <p>I have tried Concatenating ID and ID_2, then create a key number 1,2.. so that the key changes as soon as the Concatenated value changes. But I have 38L rows of data it keeps on going.</p>
  
  <p>I would appreciate any help from a person who has dealt with similar problem before.Thanks</p>