# integrate() (PR#1755)

**tcporco@mathepi.com
**
tcporco@mathepi.com

*Mon, 8 Jul 2002 02:32:41 +0200 (MET DST)*

Full_Name: Travis Porco
Version: 1.5.1 (6/17/2002)
OS: Suse Linux 7.1
Submission from: (NULL) (66.81.124.235)
This happens:
>* integrate(function(x)1,0,1)
*Error in integrate(function(x) 1, 0, 1) : evaluation of function gave a result
of wrong length
>* integrate(function(x)x^2,0,1)
*0.3333333 with absolute error < 3.7e-15
>* integrate(function(x){cat(x);1},0,1)
*0.5 0.01304674 0.9869533 0.06746832 0.9325317 0.1602952 0.8397048 0.2833023
0.7166977
0.4255628 0.5744372 0.002171418 0.9978286 0.03492125 0.9650787 0.1095911
0.8904089
0.2186214 0.7813786 0.3528036 0.6471964Error in integrate(function(x){ :
evaluation of function gave a result of wrong length
This is clearly incorrect behavior. I included case 2 to show that some cases
are
working correctly.
Various other conditions produce the error message indicated. Of course, not
being able to
integrate a constant is not in itself the problem; rather, function(x)1
generates the
same error that occurs in the real problem I'm working on.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._