Le Dimanche 17 Septembre 2006 14:12, Duncan Murdoch a écrit :
On 9/17/2006 12:36 PM, Vincent Goulet wrote:
Hy all,
Is there a direct way to build the complete function call of an arbitrary
function?
Here's what I want to do. A function will build a function which will
itself call a
Hy all,
Is there a direct way to build the complete function call of an arbitrary
function?
Here's what I want to do. A function will build a function which will itself
call a probability density function for some law given in argument to the
first function:
f(gamma, 1000)
will return,
Try this. We use do.call to call f with the args defined by ...
except that we replace the first arg with ..1+a (where ..1 means
first arg in R):
F - function(f, a)
function(...) do.call(match.fun(f), replace(list(...), 1, ..1 + a))
g - F(+, 1000)
g(1,2) # 1003
On 9/17/06, Vincent
On 9/17/2006 12:36 PM, Vincent Goulet wrote:
Hy all,
Is there a direct way to build the complete function call of an arbitrary
function?
Here's what I want to do. A function will build a function which will itself
call a probability density function for some law given in argument to the