An option with dplyr/purrr
:
library(dplyr)
library(purrr)
df <- tibble::tribble(
~Group, ~Agent_Count, ~HOUR, ~Answered_Calls, ~Aban, ~Total_Calls,
"Clinical Support", 11.75, 9L, 52.69, 2.77, 56.65,
"PW Reset", 12.06, 9L, 53.79, 22.27, 81.98,
"Technical Support", 21.15, 9L, 81.02, 2.22, 84.2
)
map_df(0:30, function(x) {df %>% mutate(across(Agent_Count:Answered_Calls, ~. + x))})
#> # A tibble: 93 × 6
#> Group Agent_Count HOUR Answered_Calls Aban Total_Calls
#> <chr> <dbl> <int> <dbl> <dbl> <dbl>
#> 1 Clinical Support 11.8 9 52.7 2.77 56.6
#> 2 PW Reset 12.1 9 53.8 22.3 82.0
#> 3 Technical Support 21.2 9 81.0 2.22 84.2
#> 4 Clinical Support 12.8 10 53.7 2.77 56.6
#> 5 PW Reset 13.1 10 54.8 22.3 82.0
#> 6 Technical Support 22.2 10 82.0 2.22 84.2
#> 7 Clinical Support 13.8 11 54.7 2.77 56.6
#> 8 PW Reset 14.1 11 55.8 22.3 82.0
#> 9 Technical Support 23.2 11 83.0 2.22 84.2
#> 10 Clinical Support 14.8 12 55.7 2.77 56.6
#> # … with 83 more rows
Or, if just needing Agent_Count
to increase:
map_df(0:30, function(x) {df %>% mutate(Agent_Count = Agent_Count + x)})
#> # A tibble: 93 × 6
#> Group Agent_Count HOUR Answered_Calls Aban Total_Calls
#> <chr> <dbl> <int> <dbl> <dbl> <dbl>
#> 1 Clinical Support 11.8 9 52.7 2.77 56.6
#> 2 PW Reset 12.1 9 53.8 22.3 82.0
#> 3 Technical Support 21.2 9 81.0 2.22 84.2
#> 4 Clinical Support 12.8 9 52.7 2.77 56.6
#> 5 PW Reset 13.1 9 53.8 22.3 82.0
#> 6 Technical Support 22.2 9 81.0 2.22 84.2
#> 7 Clinical Support 13.8 9 52.7 2.77 56.6
#> 8 PW Reset 14.1 9 53.8 22.3 82.0
#> 9 Technical Support 23.2 9 81.0 2.22 84.2
#> 10 Clinical Support 14.8 9 52.7 2.77 56.6
#> # … with 83 more rows