Re: [R] rollapply() opertation on time series

2008-07-29 Thread Gabor Grothendieck
methods(rollapply) shows which classes have rollapply methods. On Tue, Jul 29, 2008 at 5:48 PM, rcoder <[EMAIL PROTECTED]> wrote: > > Hi Gabor, > > Thanks for your reply. Assuming I have a time series that is ready made > (i.e. not constructed it using a zoo function) will the procedure below > st

Re: [R] rollapply() opertation on time series

2008-07-29 Thread rcoder
Hi Gabor, Thanks for your reply. Assuming I have a time series that is ready made (i.e. not constructed it using a zoo function) will the procedure below still retain the dates in the matrix? Thanks, rcoder quote author="Gabor Grothendieck"> rollapply along an index: library(zoo) z <- zoo(mat

Re: [R] rollapply() opertation on time series

2008-07-28 Thread Gabor Grothendieck
And then lapply over out. On Mon, Jul 28, 2008 at 6:41 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > rollapply along an index: > > library(zoo) > z <- zoo(matrix(101:110, 5), 201:205) > tt <- time(z) > zz <- zoo(seq_along(tt), tt) > out <- rollapply(zz, 3, function(ix) list(z[ix,])) > str(ou

Re: [R] rollapply() opertation on time series

2008-07-28 Thread Gabor Grothendieck
rollapply along an index: library(zoo) z <- zoo(matrix(101:110, 5), 201:205) tt <- time(z) zz <- zoo(seq_along(tt), tt) out <- rollapply(zz, 3, function(ix) list(z[ix,])) str(out) # list of zoo objects On Mon, Jul 28, 2008 at 5:03 PM, rcoder <[EMAIL PROTECTED]> wrote: > > > rcoder wrote: >> >> H