r - Pass multiple functions and their arguments to a function -


i know can pass function function 1 of parameter , use 3 dots pass additional variables. instance:

my.function <- function(x,y,fun,...) {    foo <- x+y    return(fun(foo,...)) } 

but if want pass 2 or more functions, each own parameters? this:

my.function <- function(x,y,fun1,fun2,param.fun1,param.fun2) {    foo <- x+y    return(fun1(foo, param.fun1)+fun2(x, param.fun2)) } 

where param.fun1 , param.fun2 replaced 3 dots ... , potentially many parameters.

what best way proceed?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -