# 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)) } ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
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 :-(
- Re: [R] sliding window over a large vector Dimitris Rizopoulos
- Re: [R] sliding window over a large vector Veslot Jacques
- Re: [R] sliding window over a large vector Adrian Dusa
- Re: [R] sliding window over a large vector Stavros Macrakis
- Re: [R] sliding window over a large vector Gabor Grothendieck
- Re: [R] sliding window over a large vector Gabor Grothendieck
- Re: [R] sliding window over a large vector Whit Armstrong
- Re: [R] sliding window over a large vector markleeds
- Re: [R] sliding window over a large vector Veslot Jacques
- Re: [R] sliding window over a large vector c.oldmeadow
- Re: [R] sliding window over a large vector Carl Witthoft