[R] Fixing Variables in a Function

2006-10-14 Thread Lorenzo Isella
Dear All, I am working with functions of several variables, e.g. f(x,y,z). At some point, I would like to fix y and z and consider the resulting function of x only for numerical interation with the integrate routine. I know how to define a wrapper g-function() {f(x,y,z)} , but I could not get a

Re: [R] Fixing Variables in a Function

2006-10-14 Thread Gabor Grothendieck
Try this: f - function(x, y, z) (x + y + z)^2 integrate(f, 0, 1, x = 0, z = 0) # integrate f setting x=z=0 0.333 with absolute error 3.7e-15 On 10/14/06, Lorenzo Isella [EMAIL PROTECTED] wrote: Dear All, I am working with functions of several variables, e.g. f(x,y,z). At some point,