[R] integrate over polygon

Duncan Murdoch murdoch at stats.uwo.ca
Fri Feb 16 02:45:06 CET 2007


On 2/14/2007 9:06 PM, Haiyong Xu wrote:
> Hi there,
> 
> I want to integrate a function over an irregular polygon. Is there  
> any function which can implement this easily? Otherwise, I am  
> thinking of divide the polygon into very small rectangles and use  
> "adapt" to approximate it. Do you have any suggestions to get the  
> fine division? Any advice is appreciated.

If you can integrate over a triangle, you will soon be able to use 
gpclib to triangulate the polygon.  (The code was already there in C; I 
wrote an interface to it and Roger Peng has packaged it up to send to 
CRAN.)  Wait for version 1.4 or greater to appear before downloading.

Duncan Murdoch



More information about the R-help mailing list