Skip to content

Idioms for a timeseries operation - moving window

7 messages · Bo Zhou, Gabor Grothendieck

#
See

?embed

and from zoo see:
?rollapply
?rollmean
?rollmax

There is a function coded in C in the caTools package for speed.
On Sun, Mar 2, 2008 at 9:24 AM, Bo Zhou <bozhou1981 at hotmail.com> wrote:
#
Time to upgrade to the latest version of zoo.  You can also read it online
here:
http://cran.r-project.org/web/packages/zoo
On Sun, Mar 2, 2008 at 9:47 AM, Bo Zhou <bozhou1981 at hotmail.com> wrote:
#
Try:

rollapply(x, 3, force)

or

embed(x, 3)[, 3:1]
On Sun, Mar 2, 2008 at 9:53 AM, Bo Zhou <bozhou1981 at hotmail.com> wrote: