I have a dataframe with dates that will change everymonth for the next 24 months, so I can't use the column names in my code. I want to use mutate that sums each row, so in this example sum by row columns 4:6. However, the dataframe will have 24 months, so it's not convenient to change it each time I run the file.
df <- structure(list(Region = c("Region 1", "Region 1", "Region 1","Region 1", "Region 1", "Region 1", "Region 1", "Region 1", "Region 1"), Customer = c("Customer A", "Customer B", "Customer C", "Customer D","Customer E", "Customer F", "Customer G", "Customer H", "Customer J"), Market = c("Market #1", "Market #2", "Market #3", "Market #4","Market #5", "Market #6", "Market #7", "Market #8", "Market #9"), `19-Jun` = c(21408912L, 10222308L, 9600000L, 524753L, 4200000L,529373L, 4100000L, 3391500L, 3834617L), `19-Jul` = c(33405963L,24306609L, 11528470L, 683497L, 6900000L, 763390L, 4100000L, 3510500L,3500000L), `19-Aug` = c(32784032L, 22389084L, 11528470L, 859897L,7500000L, 768152L, 4100000L, 3510500L, 4000000L)), row.names = c(NA,9L), class = "data.frame")
The expected output should be a column of the sum of each month column in the row.