I want to return all functions I have defined within a function.
I know ls() can be used to return names of my functions, but I need to return a list of the functions defined in the original function's body.
For example, my function might look like
primaryFunction<-function(){
a<-function(){return (2)}
b<-function(){return (3)}
return(?)}
where return(?) is supposed to return a list containing the functions a,b.