I have a function with many parameters which I call during some apply
method somewhere deep down my script. I thought it might be easier to save the parameter settings in some variable at the top of my script and call the variable with the parameter settings during the function call.
In mirror to this question in Python, this is what I am looking for:
# warning: pseudo-code!
params <- {'param1': 1, 'param2': 'str', 'param3':TRUE}
myfunc <- function(param1 ,param2, param3){
return(param1 ,param2, param3)
}
myfunc(params)
> 1, 'str', TRUE
I had a look at this question about dictionary functionalities in R, but many of the packages listed never made it to CRAN.
So my question: Is there a way to pass function parameters as a dictionary in a CRAN-supported way? And if so, is it proper R coding to do so?