Dear R-users, I am trying to integrate a function using integrate command in R. The function is as follows,
integrand function(x,a) { exp(-0.5*a*(1+x^2))/(1+x^2) } Now while I want to integrate it using the command integrate, I get the following error, integrate(integrand(x,2),0,inf) 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. Thanks in advance. -Cassie [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.