title: R: Two dimensional non-parametric regression
body: <p>What packages and functions in R can perform a two dimensional non-additive local regression/smooth.  For example consider</p>
  
  <pre><code>b&lt;-seq(-6*pi,6*pi,length=100)
  xy&lt;-expand.grid(b,b) 
  x=xy[[1]]
  y=xy[[2]]
  z= sin(x)+cos(y) + 2*sin(x)*cos(y)
  contour(b,b,matrix(z,100,100))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/cJ0yJ.png" alt="alt text"></p>
  
  <p>What functions could estimate this?</p>