I have a data frame (df) that has about 40 columns, and I want to aggregate using a sum on 4 of the columns. Outside of the 4 I want to sum, each unique value in column 1 co
library('dplyr')
mytb<-read.table(text="
A B C D Sum
1 A B C D 1
2 A B C D 2
3 A B C D 3
4 E F 1 R 4
5 E F 1 R 5", header=T, stringsAsFactors=F)
mytb %>%
group_by_at(names(select(mytb, -"Sum") ) ) %>%
summarise_all(.funs=sum)