title: Problems with stat_density2d() in ggplot2
body: <p>My dataset (origen) is composed by 3 columns, a factor variable (Origen), and two cuantitative variables (Ae and Adp). Some factors of the origen categorical variable are composed by only 1 or 2 observations.</p>
  
  <p>When running this code:</p>
  
  <pre><code>ggplot (origen, aes (x = Ae, y = Adp, colour = Origen)) + 
  stat_density2d(aes (fill = Origen, colour = Origen, alpha = 0.9),
  geom = "polygon", lty = 3,lwd = 0.001) + xlim(8, 23) + ylim(22, 58) + 
  scale_alpha(range = c(0, 0.2),guide = "none") + 
  geom_point(aes(fill=Origen),colour="black",pch=21,size=3,alpha=0.1)
  </code></pre>
  
  <p>I get no results for the stat_density2d function within the ggplot() one. However, when I manually remove those groups which contain only 1 or 2 observations at most, the above code works properly and the density areas appear.</p>
  
  <p>How can I avoid this issue by modifying the code? What new attributes must be writen in the stat_density2d function to run those more-than-two-observations groups as well as the points of the other groups?</p>