[R] problem with input of integrate function
dwinsemius at comcast.net
Mon Jun 17 04:15:39 CEST 2013
On Jun 16, 2013, at 6:46 PM, cassie jones wrote:
> Dear R-users,
> I am trying to integrate a function using integrate command in R.
> The function is as follows,
> Now while I want to integrate it using the command integrate, I get the
> following error,
> Error in match.fun(f) :
> 'integrand(x, 2)' is not a function, character or symbol
> I understand that the argument of integrate needs to be solely dependent on
> x, that is why it is not able to recognize the input as there are both x
> and a. But I need to have the integrand dependent on the variable a. Does
> anyone know how can I handle the problem? Any help is appreciated.
You also misspelled `Inf`
> integrand <- function(x,a=2)
0.247085 with absolute error < 3e-05
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Alameda, CA, USA
More information about the R-help