Re: [R] integrate a fuction

2011-03-04 Thread David Winsemius
On Mar 4, 2011, at 6:01 PM, santiagorf wrote: I'm having a function of the form 1> f<-function(x){ 1+ 1+return(x^p) 1+ 1+ } ,and I would like to integrate it with respect to x, where p should be any constant. One way would be to set a value for p globally and then call integrate funct

[R] integrate a fuction

2011-03-04 Thread santiagorf
I'm having a function of the form 1> f<-function(x){ 1+ 1+return(x^p) 1+ 1+ } ,and I would like to integrate it with respect to x, where p should be any constant. One way would be to set a value for p globally and then call integrate function: p=2 integrate(f, lower = -1, upper = 1) Howe