I have a dataset like this:
ID VAL
A 1
A 4
A 3
B 1
B 2
B 2
I want to add a column that gets me the cumulative sum of val per ID such as, preferably with Tidyverse functions, unless Base has something better.
ID VAL CUM
A 1 8
A 4 8
A 3 8
B 1 5
B 2 5
B 2 5
Thanks!