Hi Art, what version of Rbloomberg are you using? it looks like an old build based on using the chron date configuration you are using to retrieve data.

The new version doesn't need chron and you just have to pull in the data and manipulate the data frame. Something like

conn <- blpConnect()

start.data <- as.POSIXct("2010-08-29")
end.data <- as.POSIXct("2011-08-29")
GT2 <- bdh(conn, 'gt2 govt', 'px_last', start.data, end.data)

GT2 <- GT2[2]
GT2 <- as.xts(GT2)

should work and you could merge from there.. 

check out 
http://findata.org/rbloomberg/ 


for latest and greatest.
hope that helps
-brian


________________________________
From: Artem Simonov <scherrzo@rambler.ru>
To: r-sig-finance@r-project.org
Sent: Thursday, September 22, 2011 8:48 AM
Subject: [R-SIG-Finance] Problem with RBloomberg and xts.

Dear friends!

I'm trying to get some time series with RBloomberg and then merge them
using merge.xts function

the code is the following:

#install.packages(c("RBloomberg","xts"))
library(RBloomberg)
library(xts)
blpConnect()
symbol1<-"OGZD LI Equity"
symbol2<-"LKOD LI Equity"
s<-as.chron("2011-01-10")
e<-as.chron("2011-07-12")
ts1 <- blpGetData(conn, symbol1, "PX_LAST",
start=s,end=e)
ts2<- blpGetData(conn, symbol2, "PX_LAST",
start=s,end=e)

a_ts1<-index(ts1)
b_ts1<-as.double(ts1)
c_ts1<-as.Date(a_ts1)
m1_ts1<-matrix(b_ts1)
aa1_ts1<-as.POSIXct(c_ts1)
a11_ts1<-xts(m1_ts1,aa1_ts1)

a_ts2<-index(ts2)
b_ts2<-as.double(ts2)
c_ts2<-as.Date(a_ts2)
m1_ts2<-matrix(b_ts2)
aa1_ts2<-as.POSIXct(c_ts2)
a11_ts2<-xts(m1_ts2,aa1_ts2)

e1<-merge.xts(a11_ts1,a11_ts2,method="inner")

I've got the following warning messages:

Warning messages:
1: In merge.xts(a11_ts1, a11_ts2, method = "inner") :
NAs introduced by coercion
2: In merge.xts(a11_ts1, a11_ts2, method = "inner") :
NAs introduced by coercion

Could you please tell me what I am doing wrong or probably a shorter way
to merge two or more time series, downloaded with RBloomberg and which
may have different number of points?

[[elided Yahoo spam]]

Kind regards,
Art Simonov,
London.

_______________________________________________
R-SIG-Finance@r-project.org 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.
	[[alternative HTML version deleted]]

