"Ido M. Tamir" <[EMAIL PROTECTED]> writes: > I wanted to pass a vector of functions as an argument to a function to do > some > calculations and put the results in a list where each list entry has > the "name" of the function. > I thought I could either pass a vector of function names as character, then > retrieve the functions etc... > Or do the opposite, pass the functions and then retrieve the names, but > this seems not to be possible it occurred to me, hence my question.
Functions don't have to have names, by which I mean that the definition doesn't have to be bound to a symbol. If your function takes a list of functions then: yourFunc(theFuncs=list(function(x) x + 1)) You could force the list to have names and use them. Or you could force function names to be passed in (your other idea). + seth ______________________________________________ [email protected] 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.
