Something like this if you just want the names of the arguments and functions in the list:
f1 <- f2 <- f3 <- function(x) x a1 <- a2 <- a3 <- "14"; fun_list <- list("f1", "f2", "f3") arg_list <- list("a1", "a2", "a3") mapply(function(x, y) eval(parse(text=paste(x, "(", y, ")", sep=""))), fun_list, arg_list)
If you do not need the names in the list, but the actual arguments and functions:
fun_list <- list(f1, f2, f3) arg_list <- list(a1, a2, a3) mapply(function(x, y) x(y), fun_list, arg_list)
meuleman
source share