Skip to content
Prev 370829 / 398498 Next

Zoo rolling window with increasing window size

Use a `width` of integer index locations.  And you likely want =
"right" (or rollapplyr(), as I used).

R> set.seed(21)
R> x <- rnorm(10)
R> rs <- rollapplyr(x, seq_along(x), sum)
R> cs <- cumsum(x)
R> identical(rs, cs)
[1] TRUE


On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso
<bogaso.christofer at gmail.com> wrote: