Displaying 1 result from an estimated 1 matches for "tp3346225p3346225".
2011 Mar 10
1
Moving window per group
...1 2 7
7 1 2 8
8 2 1 0
9 2 1 1
10 2 1 2
11 2 1 3
12 3 2 0
13 3 4 2
14 3 1 6
15 3 1 7
16 3 1 6
I tried this:
library(zoo)
F$C = rollapply(as.zoo(F$B), 3, FUN = function(x) cumsum(x)-(x),na.pad=TRUE)
Thanks!
--
View this message in context: http://r.789695.n4.nabble.com/Moving-window-per-group-tp3346225p3346225.html
Sent from the R help mailing list archive at Nabble.com.