Because I had too much time on my hands, here's a little function that
will do whatever you want over a window you specify. No, I haven't done
any time trials :-(
# my own boxcar tool, just because.
# use bfunc to specify what function to apply to the windowed
# region.
boxcar<-function(x, width=5, bfunc='mean'){
bfunc<-get(bfunc)
boxout<-mapply(function(shiftx) {
bfunc(window(x,shiftx,shiftx+width))
} ,seq(1,(length(x)-width))
return(invisible(boxout))
}