Re: [R] converting a zoo or an xts to a data frame

2010-04-19 Thread Gabor Grothendieck
If z is a zoo series as.data.frame(z) converts it to a data frame. If that is not what you are asking please clarify. Also read the last line to every message to r-help asking for complete self contained code. Yours has undefined variables. Also what is the purpose of the code? Normally its unn

[R] converting a zoo or an xts to a data frame

2010-04-19 Thread Erin Hodgess
Dear R People: I have the following code that I use to convert a monthly zoo object to a data.frame, and it works perfectly: library(tseries) z <- get.hist.quote(instrument=inst1, start=start1,end=end1, quote=quot1,comp = "m") y <- as.ts(aggregate(z, as.yearmon, tail, 1)