[R] Reorganizing Data Frame

chris99 cheakes at hotmail.com
Tue Jan 18 20:50:16 CET 2011


Hi I need some help trying to restructure a data frame:

I have:
food    transaction     quantity
pizza         BUY              5
pizza         SELL              3
apple         BUY              2
orange       SELL              1
pizza         BUY               2


And the data frame I want to make is:

food        BUY          SELL
pizza         7             3
apple         2             0
orange       0             1



I can't figure out the commands to use. Can anyone help?
-- 
View this message in context: http://r.789695.n4.nabble.com/Reorganizing-Data-Frame-tp3223863p3223863.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list