title: The hourly mean for a time series in R
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12070867/the-hourly-mean-in-time-series">The hourly mean in time series</a>  </p>
  </blockquote>
  
  
  
  <p>I have a time series:</p>
  
  <p>It is data that is measured every 30min, so I have 536 days with</p>
  
  <pre><code>n=25728. 
  </code></pre>
  
  <p>It is a <code>ts</code> with one column and <code>freq=48</code>. I would like to calculate the mean for every 30min.</p>
  
  <p>So for example: </p>
  
  <pre><code>First 30min:
  ts[1]+t[49]+t[97]+t[145]+.../536 days
  
  Second 30min:
  t[2]+t[50]+t[98]+..../536 days
  </code></pre>
  
  <p>What is the best code?</p>