title: how can I change column values to column names in R
body: <p>I have a data frame A which looks like this: there are multiply recurring ID's</p>
  <pre><code>ID    |  shopping list
  1     |  carrot
  1     |  milk
  1     |  apple
  2     |  milk
  2     |  chicken
  3     |  milk
  4     |  carrot
  </code></pre>
  <p>and I want to get a data frame B: where there are only unique ID values and all shopping list products have their own column. If an ID has a certain product on their shopping list the value is 1 and if it's not the value is 0 for that item.</p>
  <pre><code>ID    |  milk | carrot | apple | chicken
  1     |  1    | 1      | 1     | 0
  2     |  1    | 0      | 0     | 1
  3     |  1    | 0      | 0     | 0
  4     |  0    | 1      | 0     | 0
  </code></pre>