Re: [R] List of zoo multivariate series

From: Allan Engelhardt <allane_at_cybaea.com>
Date: Wed, 30 Jun 2010 10:26:07 +0100

help("[[")

e.g.

plot(test[[2]])

Hope this helps

Allan

On 30/06/10 10:09, Research wrote:
> Hi,
>
> I have a list which is basically a database of zoo multivariate objects:
>
> x.Date <- as.Date("2003-02-01") + c(1:100) - 1
> x <- zoo(rnorm(100), x.Date)
> z <- zoo(rnorm(100), x.Date)
> y <- zoo(rnorm(100), x.Date)
> k <- zoo(rnorm(100), x.Date)
>
> a<-merge(x,z)
> b<-merge(y,k)
> c<-merge(z,x,y)
>
> test<-list(a=a, b=b, c=c)
>
> Can I access the elements of the list in a for/next do loop?
>
> for example something like:
>
> for (i in 1:3)
> {
> x11()
> plot(test[i])
> }
>
> So far I can only recover the zoo objects as test$a, test$b etc. etc...
>
> Thanks,
> Costas
>
> ______________________________________________
> 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 Wed 30 Jun 2010 - 09:29:11 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 Jun 2010 - 10:20:43 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