title: Finding the max per grouped variable and convert in new variables
body: <p>I have the following data set and I would like to identify the product with the highest amount per customer_ID and convert it into a new column.  I also want to keep only one record per ID.</p>
  
  <p>Data to generate the data set:</p>
  
  <p><code>x &lt;- data.frame(customer_id=c(1,1,1,2,2,2), 
        product=c("a","b","c","a","b","c"), 
        amount=c(50,125,100,75,110,150))</code></p>
  
  <p>Actual data set looks like this:</p>
  
  <p><code>customer_id product amount
  1            a       50
  1            b       125
  1            c       100
  2            a       75
  2            b       110
  2            c       150</code></p>
  
  <p>Desired output wanted should look like this: </p>
  
  <p><code>customer_ID  product_b product_c
  1            125       0
  2            0         150</code></p>