[R] partial cumsum

mayouf.k mayouf.k at gmail.com
Mon May 30 10:03:13 CEST 2011


thank u very much Wiliam Dunlap,
your function is very helpful, i been trying to find the right algo,,,and i
saw yours, it works perfectly.
i even checked with system.time function, and it's clear the cum.reset is
the best.

> system.time(ave(J, rev(cumsum(rev(is.na(J)))), FUN=cumsum)) 
utilisateur     système      écoulé 
       0.18        0.00        0.19 
> system.time(cumsum.reset(J))
utilisateur     système      écoulé 
          0           0           0 

thks  

--
View this message in context: http://r.789695.n4.nabble.com/partial-cumsum-tp899789p3560134.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list