I haven't quite figured out how I can change the environment of a function. I have a main function and want to use different auxillary functions, which I supply as parameter (or names). What I want to do is something like this: main.fun=function(aux.fun,dat){ x <- 1 fun.dat() } aux.fun.one=function(){ mean(dat)+x } aux.fun.one=function(){ median(dat)-x } I don't want to transfer the dat variable as a parameter as it can get pretty large. The enclosing environment of both auxillary functions is the Global environ, so they cannot see neither dat nor x as they exist inside the scope of the main function. So how do I do this? Thanks, René
[[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.