Given the data Below, create 3 columns ie Sum_15, Sum_16, Sum_17 whereby sum_* is the sum of the values for the corresponding year and agegroup. The result should look like shown below:
AgeGroup
Sum_15
Sum_16
Sum_17
A
321
342
372
B
391
339
345
C
353
361
363
D
356
388
359
E
351
390
386
set.seed(100) # make results reproducible by setting seedvars <-c("AgeGroup", paste0(month.abb, "_", rep(15:17, each =12)))(df <-cbind(LETTERS[1:5], matrix(rpois(n = (length(vars) -1) *5, 30), nrow =5)) %>%data.frame() %>%setNames(vars) %>%tibble() %>%mutate(across(-1, as.integer)))