Re: [Bioc-devel] helper function arguments: best practice

2021-04-19 Thread Manders-2, F.M.
Hi Severin, I understand that the helper_function is not defined in the main function. The anonymous function inside the lapply call however is, which means it can use the (list of) variables in the main function. You still need to pass the list of arguments to the helper_function, but not also

Re: [Bioc-devel] helper function arguments: best practice

2021-04-19 Thread Severin Bang
Hi Freek, the helper_function() is not defined in the main function, but only called there. I decided to pass a named list of parameters, from which each helper function grabs those it needs. I also thought about defining the function in the main function, but decided that this neither helps

Re: [Bioc-devel] helper function arguments: best practice

2021-04-19 Thread Manders-2, F.M.
Hi Severin, I'm not sure what the best practice is, but since your anonymous function is defined inside your main function, you don't need to supply it with all those arguments. This should also work, because R has lexical scoping: main_function <- function(alot, of, paramters) { var01 <- foo

[Bioc-devel] helper function arguments: best practice

2021-04-16 Thread Severin Bang
Dear community, I am writing my first package with the aim to publish it on Bioconductor. To structure the code and make it  (human) readable I have defined some helper functions, that will not be exported. The main function (which will be user available) makes some data structuring, defines