CHR_NR diffdato diffCHR aar ind10 diffind10 dato63 diffdato63
diffdato1 x akkusum
12558 2000-06-30 49.8 38 0 2000 1 1 0
0 27 1 1 118 27 12558 2000-07-27 51.0 27
0 2000 1 0 0 0 14 0 1 118 41
12558 2000-08-10 36.6 14 0 2000 1 0 0
0 14 0 1 118 55
12558 2000-08-24 18.6 14 0 2000 1 0 0
0 14 0 1 118 69
12558 2000-09-07 21.9 14 0 2000 1 0 0
0 14 0 1 118 83
12558 2000-09-21 14.4 14 0 2000 1 0 0
0 35 0 1 118 118
So I want the vector "akkusum" just for the whole dataset, i thought of
using af for loop with cumsum (which i have used in the example with x=118
where i did a$akkusum <- cumsum(a$diffdato1)), but i don't know how to set
it up.
Hope anyone can help me.