[R] Reorganize data frame

2011-03-16 Thread chris99
Hi group, I am trying to convert the organization of a data frame so I can do some correlations between stocks, I have something like this: stock.returns <- data.frame(rbind(c("MSFT","20110301",0.05),c("MSFT","20110302",0.01),c("GOOG","20110301",-0.01),c("GOOG","20110302",0.04))) colnames(stock.

[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

[R] Help summarizing R data frame

2010-12-02 Thread chris99
I am trying to aggregate data in column 2 to identifiers in col 1 eg.. take this> identifier quantity 1 10 1 20 2 30 1 15 2 10 3 20 and make this> identifier q