Sergey,

The data.frame retval seems to work with 1 ticker, but not with 2. Can you
fetch them one at a time and then merge the data frames?

Also, you can try passing the dates directly into blpGetData as strings.

The 1899 start date comes from COM/Microsoft Excel. If you look in
as.chron.COMDate.R in the source, you can see the conversion function.

-Ana


2009/1/19 Sergey Goriatchev <sergeyg@gmail.com>

> Hello everyone,
>
> I have two issues that I want to ask.
>
> 1)
> I have problems with loading data with RBloomberg.
> More precisely, I do not seem to be able to load data into a data.frame.
> I get an error message:
>
> start.date      <- as.chron("1990-01-19")
> end.date        <- as.chron("2009-01-19")
>
> conn <- blpConnect(show.days="week", na.action="na", periodicity="daily")
>
> > bldata <- blpGetData(conn, c("ED4 Comdty", "ED12 Comdty"), "PX_LAST",
> start=start.date, end=end.date, retval="data.frame")
> Error in if (typ[n] == "character") { : argument is of length zero
>
> What does that error message mean and what can I do to avoid this error
> message?
>
> 2)
> If I load data from Bloomberg in matrix format, the date is converted
> to a number. For example:
>
> > bldata <- blpGetData(conn, "ED4 Comdty", "PX_LAST", start=start.date,
> end=end.date, retval="matrix")
> > head(bldata)
>     [DATETIME] PX_LAST
> [1,]      32892   91.36
> [2,]      32895   91.37
> [3,]      32896   91.38
> [4,]      32897   91.38
> [5,]      32898   91.34
> [6,]      32899   91.28
>
> I tried to convert the number to normal date and by trial and error I
> found the following:
>
> > as.Date(32892, "1899-12-30")
> [1] "1990-01-19"
>
> Is it really true that count starts from December 30th 1899? Why?
>
> Thank you in advance for your help!
>
> Regards,
> Sergey
>
> _______________________________________________
> R-SIG-Finance@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.
>

	[[alternative HTML version deleted]]

