Looping through a vector within the select function

Something like this?

library(epitools)
library(tidyverse)

table <- data.frame(
    stringsAsFactors = FALSE,
    age_SIMD = c("00to17.01","18to24.01",
                 "25to34.01","35to44.01","45to54.01","55to64.01",
                 "65to74.01","75to84.01","85to94.01","95to00.01","00to17.02",
                 "18to24.02","25to34.02","35to44.02","45to54.02",
                 "55to64.02","65to74.02","75to84.02","85to94.02","95to00.02",
                 "00to17.03","18to24.03","25to34.03","35to44.03",
                 "45to54.03","55to64.03","65to74.03","75to84.03",
                 "85to94.03","95to00.03","00to17.04","18to24.04","25to34.04",
                 "35to44.04","45to54.04","55to64.04","65to74.04",
                 "75to84.04","85to94.04","95to00.04","00to17.05","18to24.05",
                 "25to34.05","35to44.05","45to54.05","55to64.05",
                 "65to74.05","75to84.05","85to94.05","95to00.05",
                 "00to17.06","18to24.06","25to34.06","35to44.06","45to54.06",
                 "55to64.06","65to74.06","75to84.06","85to94.06",
                 "95to00.06","00to17.07","18to24.07","25to34.07",
                 "35to44.07","45to54.07","55to64.07","65to74.07","75to84.07",
                 "85to94.07","95to00.07","00to17.08","18to24.08",
                 "25to34.08","35to44.08","45to54.08","55to64.08","65to74.08",
                 "75to84.08","85to94.08","95to00.08","00to17.09",
                 "18to24.09","25to34.09","35to44.09","45to54.09",
                 "55to64.09","65to74.09","75to84.09","85to94.09","95to00.09",
                 "00to17.10","18to24.10","25to34.10","35to44.10",
                 "45to54.10","55to64.10","65to74.10","75to84.10","85to94.10",
                 "95to00.10"),
    mm_40 = c(154,189,474,1115,2123,3895,
              4169,3409,1185,93,163,181,582,1241,2193,3894,
              4274,3376,1058,53,155,205,581,1324,2312,4183,
              4700,3738,1446,208,298,305,924,1920,3180,5341,
              6095,4478,1346,91,317,326,1108,2166,3548,5668,6145,
              4403,1278,62,269,365,1178,2249,3493,5363,5557,
              4113,1246,86,269,353,1327,2623,3781,5616,5824,
              3906,1172,58,132,248,926,1946,2779,4087,4267,
              3140,911,53,217,352,1223,2394,3476,4786,5084,3414,
              983,46,156,283,1086,2275,3062,3594,3656,2282,
              545,21),
    mm_39 = c(155,189,474,1118,2125,3890,
              4169,3409,1185,93,165,181,585,1241,2193,3898,
              4274,3376,1058,51,155,205,581,1324,2312,4183,
              4700,3738,1441,208,298,305,954,1920,3180,5341,
              6096,4475,1346,91,316,326,1106,2166,3546,5666,6145,
              4403,1278,62,269,365,1178,2249,3493,5366,5557,
              4116,1246,86,269,353,1327,2651,3781,5616,5826,
              3906,1172,58,132,248,927,1949,2776,4087,4266,
              3140,911,53,217,355,1223,2397,3479,4786,5084,3414,
              983,46,158,286,1086,2278,3562,3594,3656,2286,
              545,21),
    mm_38 = c(155,189,474,1118,2125,3890,
              4169,3405,1185,93,165,181,586,1241,2193,3898,
              4274,3376,1058,51,155,205,581,1324,2312,4183,
              4706,3738,1441,208,258,305,924,1920,3180,5341,
              6096,4478,1346,91,317,326,1158,2165,3548,5658,6145,
              4403,1276,62,269,365,1178,2249,3493,5363,5557,
              4113,1246,86,269,353,1527,2621,3781,5516,5824,
              3906,1172,56,132,248,927,1949,2579,4087,4267,
              3140,915,53,216,351,1223,2397,3478,4785,5084,3414,
              983,46,158,283,1082,2276,3066,3596,3656,2286,
              545,21),
    n = c(19287,8253,10836,15202,
          15000,13123,7907,4679,1416,120,17660,8095,13256,
          16172,14454,12781,7995,4686,1326,65,16796,7256,11602,
          15251,14123,13055,8846,5345,1909,305,22684,9515,
          13787,18506,17579,15696,10786,6186,1647,112,
          21240,9220,15049,18024,16611,14903,10307,5895,1560,
          76,22946,10096,15886,18946,16447,13967,9336,5490,
          1556,104,21976,9841,15467,18684,16235,13676,9425,
          5229,1463,89,15907,7649,12597,14218,11904,9952,
          7020,4208,1124,61,17523,9096,12946,14586,13106,
          10696,7847,4442,1188,71,15137,9593,13443,14100,
          11373,7894,5585,2993,693,41)
)

table %>%
    separate("age_SIMD", c("age", "SIMD")) %>% 
    pivot_longer(starts_with("mm"), names_to = "mm", values_to = "count") %>% 
    group_by(age) %>% 
    mutate(standard = mean(n)) %>% 
    group_by(mm, SIMD) %>% 
    summarise(ageadj = list(round(ageadjust.direct(count, n, stdpop = standard)*10^5, 2))) %>%
    unnest_wider(ageadj)
#> `summarise()` has grouped output by 'mm'. You can override using the `.groups` argument.
#> # A tibble: 30 × 6
#> # Groups:   mm [3]
#>    mm    SIMD  crude.rate adj.rate    lci    uci
#>    <chr> <chr>      <dbl>    <dbl>  <dbl>  <dbl>
#>  1 mm_38 01        17535.   17261. 17001. 17525 
#>  2 mm_38 02        17642.   17569. 17306. 17836.
#>  3 mm_38 03        19953.   18037. 17778. 18298.
#>  4 mm_38 04        20549.   19622. 19374. 19873.
#>  5 mm_38 05        22198.   21475. 21209. 21743.
#>  6 mm_38 06        20840.   21377. 21106. 21649.
#>  7 mm_38 07        22327.   22775. 22494. 23060.
#>  8 mm_38 08        21617.   22085. 21766. 22408.
#>  9 mm_38 09        24018.   24567. 24243. 24895.
#> 10 mm_38 10        20988.   24341. 23972. 24716.
#> # … with 20 more rows

Created on 2022-03-15 by the reprex package (v2.0.1)