Skip to content
Prev 164866 / 398503 Next

sliding window over a large vector

Hi: Veslot:  I'm too tired to even try to figure out why but I think 
that there is something wrong with your sl function. see below for an 
empirical
proof of that statement.  OR maybe you're definition of sliding window 
is different than rollapply's definition but rollapply's answer makes
more sense to me ?

Output
[1] 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 1 1 0 1 0
[1] 1 1 2 2 1 2 2 2 2 1 1 1 2 1 2 1 2 2 1 2 2
2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  1  2  2  2  2  3  3  2  1  0  1  1  2  1  2  2  2  2  2  2  2  1
On Tue, Dec 16, 2008 at 3:47 AM, Veslot Jacques wrote: