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

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon, 28 Jul 2008 19:07:22 -0400

And then lapply over out.

On Mon, Jul 28, 2008 at 6:41 PM, Gabor Grothendieck <ggrothendieck_at_gmail.com> 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(out) # list of zoo objects
>
>
> On Mon, Jul 28, 2008 at 5:03 PM, rcoder <mpdotbook_at_gmail.com> wrote:
>>
>>
>> rcoder wrote:
>>>
>>> Hi everyone,
>>>
>>> Is there a way to perform a rollapply operation on a time series data
>>> matrix and preserve the time frame? Currently, when I apply rollapply in
>>> its standart form, the date column is no longer present in the o/p matrix.
>>>
>>> Thanks,
>>>
>>> rcoder
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/rollapply%28%29-opertation-on-ts-matrix-tp18694735p18699707.html
>> Sent from the R help mailing list archive at Nabble.com.
>>
>> ______________________________________________
>> 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.
>>
>



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. Received on Mon 28 Jul 2008 - 23:09:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Jul 2008 - 00:32:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive