Displaying 1 result from an estimated 1 matches for "348680".
Did you mean:
34680
2009 Jul 28
1
Cumulative row sums, row differences
I tried searching but I couldn't quite find what I was looking for.
Here's a dummy data matrix (with row and column labels):
> y
0 1 2 3 4
21 3 4 8 5 5
22 3 6 8 6 NA
23 4 5 11 4 3
24 4 2 1 4 6
25 6 4 4 6 6
I can get cumulative row sums as follows:
> cy<-t(apply(y,1,cumsum))
> cy
0 1 2 3 4
21 3 7 15 20 25
22 3 9 17 23 NA
23 4 9 20 24 27
24 4 6 7 11 17