R: calculate average over a specific time window in a time series data frame
<p>My dataset is a bit noisy at 1-min interval. So, I'd like to get an average value every hour from 25 min to 35 min to stand for that hour at 30 min.</p>

<p>For example, an average average at: 00:30 (average from 00:25 to 00:35), 01:30 (average from 01:25 to 01:35), 02:30 (average from 02:25 to 02:35), etc. </p>

<p>Can you good way to do this in R?</p>

<p>Here is my dataset:</p>

<pre><code>  set.seed(1)
  DateTime &lt;- seq(as.POSIXct("2010/1/1 00:00"), as.POSIXct("2010/1/5 00:00"), "min")
  value &lt;- rnorm(n=length(DateTime), mean=100, sd=1)
  df &lt;- data.frame(DateTime, value)
</code></pre>

<p>Thanks a lot.</p>