search for: cumsumi

Displaying 1 result from an estimated 1 matches for "cumsumi".

Did you mean: cumsum
2012 Jul 27
4
why order doesn't work?
hi all, I want to get a cumsum according to the order of some variable. However, it doesnt' work. For example, ********************** test<-data.frame(cbind(x=c(3,5,2,6,7),y=c(8,1,4,9,0))) test[order(test$x),]$sumy<-cumsum(test[order(test$x),]$y) ********************** R complians Warning message: In `[<-.data.frame`(`*tmp*`, order(test$x), , value = list(x = c(2, : provided 3