I'm guessing that the input has the names as character strings. In the code that I sent, the function names are being invoked.
Here some code that you can adapt for your project:
library(yardstick)
library(purrr)
library(rlang)
#>
#> Attaching package: 'rlang'
#> The following objects are masked from 'package:purrr':
#>
#> %@%, flatten, flatten_chr, flatten_dbl, flatten_int, flatten_lgl,
#> flatten_raw, invoke, splice
# Get the names of the functions
chr_functions <- c("roc_auc", "accuracy", "bal_accuracy", "sensitivity")
# Get the actual functions from yarstick
metric_functions <- map(chr_functions, ~ getFromNamespace(.x, ns = "yardstick"))
# slice them in
m1 <- metric_set(!!!metric_functions)
m1
#> # A tibble: 4 × 3
#> metric class direction
#> <chr> <chr> <chr>
#> 1 <prb_mtrc> prob_metric maximize
#> 2 <clss_mtr> class_metric maximize
#> 3 <clss_mtr> class_metric maximize
#> 4 <clss_mtr> class_metric maximize
Created on 2023-08-21 with reprex v2.0.2