title: How can I calculate the area within a contour in R?
body: <p>I'm wondering if it is possible to caclulate the area within a contour in R.</p>
  
  <p>For example, the area of the contour that results from:</p>
  
  <pre><code>sw&lt;-loess(m~l+d)
  mypredict&lt;-predict(sw, fitdata) # Where fitdata is a data.frame of an x and y matrix
  
  contour(x=seq(from=-2, to=2, length=30), y=seq(from=0, to=5, length=30), z=mypredict)
  </code></pre>
  
  <p>Sorry, I know this code might be convoluted. If it's too tough to read. Any example where you can show me how to calculate the area of a simply generated contour would be helpful.</p>
  
  <p>Thanks for any help.</p>