Re: [R] Reorganizing Data Frame

2011-01-18 Thread Henrique Dallazuanna
Try this: xtabs(quantity ~ food + transaction, DF) On Tue, Jan 18, 2011 at 5:50 PM, chris99 wrote: > > Hi I need some help trying to restructure a data frame: > > I have: > foodtransaction quantity > pizza BUY 5 > pizza SELL 3 > apple BU

[R] Reorganizing Data Frame

2011-01-18 Thread chris99
Hi I need some help trying to restructure a data frame: I have: foodtransaction quantity pizza BUY 5 pizza SELL 3 apple BUY 2 orange SELL 1 pizza BUY 2 And the data frame I want to ma