[R] Problem in Converting Zoo Objects to Dataframes

From: Shubha Vishwanath Karanth <shubhak_at_ambaresearch.com>
Date: Wed 13 Dec 2006 - 09:38:01 GMT


Hi R experts,  

The below is an RBloomerg command. The object "intra" here is a zoo object. I need to convert this zoo object into a data frame, called bb.

"

library(zoo)

library(chron)

library(RDCOMClient)

library(RBloomberg)  

conn<-blpConnect(show.days="trading",na.action="previous.days",periodici ty="daily")

intra<-blpGetData(conn, c("NOK1V FH Equity","AUA AV Equity"), "LAST_PRICE", start=as.chron(as.Date("10/11/2006", "%m/%d/%Y")),end=as.chron(as.Date("12/5/2006","%m/%d/%Y")),barfields="VO LUME", barsize=10)

bb=as.data.frame(intra)

blpDisconnect(conn)  

"  

But there is some problem in converting "intra" zoo object to "intra" a data frame. I get the below error.  

> bb=as.data.frame(intra)

Error in substr(x, as.integer(start), as.integer(stop)) :

        invalid substring argument(s) in substr()  

For this matter, is I give "intra" in the command prompt of R, I get the same error message:  

> intra

Error in substr(x, as.integer(start), as.integer(stop)) :

        invalid substring argument(s) in substr()  

> class(intra)

[1] "zoo"    

Can anybody help me on this?  

Thanks in advance..

        [[alternative HTML version deleted]]



R-help@stat.math.ethz.ch 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 Dec 13 21:22:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 13 Dec 2006 - 10:30:22 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.