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

Brian G. Peterson brian at braverock.com
Tue May 25 15:19:09 CEST 2010


zoo/xts are not data frames.  For zoo/xts, the underlying storage object is a 
matrix, so you can certainly access columns using the $ operator, but unlike a 
data frame, it is not actually stored internally as separate objects per column.

For big time series data in zoo/xts, take a look at the 'indexing' package if 
you are really likely to access primarily by columns.


    - Brian

On 05/25/2010 08:11 AM, Matthieu Stigler 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.

Brian G. Peterson
Ph: 773-459-4973
IM: bgpbraverock

More information about the R-SIG-Finance mailing list