search for: asfunctionof

Displaying 1 result from an estimated 1 matches for "asfunctionof".

Did you mean: asfunction
2006 Dec 18
3
turning expression object to function
...bject 'expr' containing a certain set of symbols (say 'a', 'b', 'c'), I would like to translate the expression object in an R function of, say, 'a', programmatically. Here an example of what I mean. Given: > expr <- expression(a+b+c) a call like: > asFunctionOf(expr, 'a', list(b=1, c=2)) should return a function (not necessarly formally) equivalent to > function(a) a+1+2 Some suggestions? Best regards, Antonio.