This is probably simple, but I cannot figure it out. In R, I would like to take adjacent values and add to the sum of the values in another column. In Excel it would be where the value is added to the cell value along with the value of the cell above except for very first value because there is no value above. Better explained is this table.
value | value_summed |
---|---|
28 | 28 |
41 | 69 |
71 | 140 |
92 | 232 |
39 | 271 |
64 | 335 |
25 | 360 |
21 | 381 |
17 | 398 |
59 | 457 |
38 | 495 |
97 | 592 |
How do I do this?
Thanks,
Jeff