title: Calculating average for certain time period in every year
body: <p>I need to calculate seasonal averages for my data every year, the calculation of average is not in the same calendar year. I have defined season by date and am looking to calculate average temperature, precipitation etc for that time period every year (eg <code>12/21/1981</code> to <code>02/15/1982</code> , <code>12/21/1982</code> to <code>02/15/1983</code>) and so on.</p>
  
  <p>Is there an efficient way of doing this in R? </p>
  
  <p>Below is my data:</p>
  
  <pre><code>library(xts)
  seq &lt;- timeBasedSeq('1981-01-01/1985-06-30') 
  Data &lt;- xts(1:length(seq),seq) 
  </code></pre>
  
  <p>Thanks</p>