title: ggplot2 density of circular data
body: <p>I have a data set where <code>x</code> represents day of year (say birthdays) and I want to create a density graph of this. 
  Further, since I have some grouping information (say boys or girls), I want to use the capabilities of <code>ggplot2</code> to make a density plot.</p>
  
  <p>Easy enough at first:</p>
  
  <pre><code>require(ggplot2); require(dplyr)
  bdays &lt;- data.frame(gender = sample(c('M', 'F'), 100, replace = T), bday = sample(1:365, 100, replace = T))
  bdays %&gt;% ggplot(aes(x = bday)) + geom_density(aes(color = factor(gender)))
  </code></pre>
  
  <p>However, this gives a poor estimate because of edge effects.
  I want to apply the fact that I can use circular coordinates so that 365 + 1 = 1 -- one day after December 31st is January 1st.
  I know that the <code>circular</code> package provides this functionality, but I haven't had any success implementing it using a <code>stat_function()</code> call.
  It's particularly useful for me to use <code>ggplot2</code> because I want to be able to use facets, <code>aes</code> calls, etc.</p>
  
  <p>Also, for clarification, I would like something that looks like <code>geom_density</code> -- I am not looking for a polar plot like the one shown at: <a href="https://stackoverflow.com/questions/26030244/circular-density-plot-using-ggplot2">Circular density plot using ggplot2</a>.</p>