title: volume from the surface down to a contour in R
body: <p>I need to find the volume from the surface down to a specific contour in R. Taking the contour example from the R help files:</p>
  
  <pre><code>x &lt;- 10*1:nrow(volcano)
  y &lt;- 10*1:ncol(volcano)
  contour(x,y,volcano)
  </code></pre>
  
  <p>given the resulting graph, how do I find the volume from a specific contour line up to the surface.</p>
  
  <p>In practice, I will use bkde2D to get a density map for a scatter plot. From this I can make the contour plot, but I would like to determine the volume defined by various density cutoffs in the resulting plot.</p>