[R-SIG-Finance] can I 'attach' a zoo object?

Gabor Grothendieck ggrothendieck at gmail.com
Tue May 25 15:19:45 CEST 2010


Try this:

   attach(as.list(zoo1))

Also this works:

   with(zoo1, sum(vara + varb))



On Tue, May 25, 2010 at 9:11 AM, Matthieu Stigler
<matthieu.stigler at gmail.com> wrote:
> Hi
>
> When importing a big data frame, I like to "attach" its variables so they
> are direclty available. I don't see how to do this with zoo... Does anyone
> has an idea how I could do that?
>
> Take a zoo object:
>
> library(zoo)
>
> zooframe<-matrix(runif(3*26), nrow=3, dimnames=list(letters[1:3],
> paste("var", letters, sep="")))
>
> zoo1 <-zoo(zooframe, order.by=as.Date("2003-02-01") + c(1,
> 3, 7))
>
>
> Can I 'attach' it, so its variables become accessible to user workspace?
>
> attach(zoo1)
>
> #does not work...
>
> Thanks!
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>



More information about the R-SIG-Finance mailing list