Displaying 1 result from an estimated 1 matches for "tp3421513p3422619".
2011 Apr 02
0
cumsum while maintaining NA
...1, function(x) ave(x,is.na(x),FUN=cumsum)))
print(res)
x1 x2 x3 x4 x5 x6
[1,] NA NA 3 7 NA NA
[2,] 5 8 12 NA NA NA
[3,] 7 10 14 18 NA NA
[4,] 11 14 18 23 NA NA
[5,] 67 71 75 NA NA NA
HTH
Pete
--
View this message in context: http://r.789695.n4.nabble.com/cumsum-while-maintaining-NA-tp3421513p3422619.html
Sent from the R help mailing list archive at Nabble.com.