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

From: rcoder <mpdotbook_at_gmail.com>
Date: Tue, 29 Jul 2008 14:48:52 -0700 (PDT)

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(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.
-- 
View this message in context: http://www.nabble.com/rollapply%28%29-opertation-on-ts-matrix-tp18694735p18721849.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.
Received on Tue 29 Jul 2008 - 23:35: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 Wed 30 Jul 2008 - 01:33:09 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