I am looking for a way to summarise consecutive columns in a data frame, meaning summarise col2 + col1, col3+col2+col1, col4+col3+col2+col1, etc.
the output of each new column should be the sum of all previous columns.
I'm trying to combine the
across command from tidyverse, but I can't get it right.
any help would be appreciated.