df <- as_tibble(a <- c(1,2,3))
df
# A tibble: 3 x 1
value
<dbl>
1 1
2 2
3 3
The goal is this:
# A tibble: 3 x 2
value Sum
<dbl>
1 1 1
2 2 3
3 3 6
So just display the sum after each row. 1 = 1. 1+2 = 3. 3+3 = 6, and so on. I guess it's kinda easy, maybe with rowSums?