Someone decided my question to apply the list of functions in the list of arguments by order , now I have another similar question, how to apply the function in the list my name? For example, if I have:
f1 <- function(x) {x} f2 <- function(x) {2*x} f3 <- function(x) {3*x} fun_list <- list(good=f1, better=f2, best=f3) arg_list <- list(better=1, best=2, good=3)
I want to get a list of functions called by their named parameter, i.e. I want:
some_magic_fun(fun_list, arg_list) == list(f1(3), f2(1), f3(2))
What would be a good way to do this?
r
user3684014
source share