title: fill gaps in a timeseries with averages
body: <p>I have a dataframe like so:</p>
  
  <pre><code>day         sum_flux  samples mean
  2005-10-26     0.02     48    0.02
  2005-10-27     0.12     12    0.50
  </code></pre>
  
  <p>It's a series of daily readings spanning 5 years, however some of the days are missing. I want to fill these days with the average of that month from other years.</p>
  
  <p>i.e if 26-10-2005 was missing I'd want to use the average of all Octobers in the data set.
  if all of October was missing I'd want to apply this average to each missing day.</p>
  
  <p>I think I need to build a function (possibly using plyr) to evaluate the days. However I'm very inexperienced with using the various timeseries objects in R, and conditionally subsetting data and would like some advice. Especially regarding which type of timeseries I should be using.</p>
  
  <p>Many Thanks</p>