Skip to content
Back to formatted view

Raw Message

Message-ID: <971536df0809270759j222c438es34007b02d384aeb8@mail.gmail.com>
Date: 2008-09-27T14:59:31Z
From: Gabor Grothendieck
Subject: Moving windows solution
In-Reply-To: <75c97be2-636d-4490-ba0c-526b174931b0@t54g2000hsg.googlegroups.com>

rollapply in the zoo package does that. See ?rollapply and the
three accompanying vignettes.

> library(zoo)
> z <- zoo(1:10)
> rollapply(z, 3, sum)
 2  3  4  5  6  7  8  9
 6  9 12 15 18 21 24 27


On Sat, Sep 27, 2008 at 10:45 AM, milicic.marko <milicic.marko at gmail.com> wrote:
> Is there an implementation of moving window functionality so I can
> apply any function while sliding trough window.
>
>
> Thanks
>
> ______________________________________________
> R-help at 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.
>