Skip to content
Prev 314861 / 398506 Next

Integration in R

Please reply on list.
On Jan 8, 2013, at 10:27 AM, Naser Jamil wrote:

            
No, it doesn't come from those conditions. It is being grabbed from  
some "x"-named object that exists in your workspace.

If your limits were 7 in both dimensions, then the code should be:

adaptIntegrate(f, lowerLimit = c(0, 0), upperLimit = c(7,7))
#----
$integral
[1] 228.6667

(At this point I was trusting R's calculus abilities more than yours.  
I wasn't too trusting of mine either, and so tried seeing if Wolfram  
Alpha would accept this expression:
  integrate 2/3 (x+y) over 0< x<7,  0<y<7

; which it did and calculating the decimal expansion of the exact  
fraction:

 > 686/3
[1] 228.6667
 >