Skip to content
Prev 241508 / 398500 Next

sum in vector

Have a look at the reshape2 package.  http://had.co.nz/reshape/
reshape2 is, to the user a slight modification of rehape but the author says it is much faster.

The code below seems to do what you want.
-------------------------------------------------------------
xx <- data.frame(market, price)
library(reshape2)
yy <- melt(xx, id=1)
dcast(yy, market ~ variable, sum)
-------------------------------------------------------------
--- On Sun, 11/14/10, lgpeco <pavic.olic at gmail.com> wrote: