I am working in R. I have a data frame with three columns. Column A contains Company names column b contains date and column c contains prices
>
   A           B          C
  Apple     2012/06/01   410
  Coke      2012/06/01   210
  Pepsi     2012/06/01   152
  Apple     2012/06/02   420
  Coke      2012/06/02   220
  Pepsi     2012/06/02   142
  Apple     2012/06/03   440
  Coke      2012/06/03   260
  Pepsi     2012/06/03   122
I want to reshape my data frame so that Company name becomes row names and date becomes column names and price is in the corresponding cell
             Apple     Coke    Pepsi
2012/06/03   410      210      152
2012/06/03   420      220      142
2012/06/03   460      260      162
I tried using melt and dcast function, but couldn't find a solution.
 
     
     
    