[R-SIG-Finance] Importing batch tickers from Bloomberg to R for Rblpapi use
Nick White
n-e-w at qtradr.net
Thu Apr 7 05:17:28 CEST 2016
Yes - this is very easy.
Do you get the error message when you run the bdp command or when you try
to run the read.csv command?
If it's after read.csv, can you supply an extract of the header row and
the first row of tickers so we can see what your file looks like? How you
read in a csv is largely a function of how you've set it up.
Alternatively, you could just paste in the result of
str(imp)
if the read.csv command succeeds.
The default behavior of read.csv is to convert strings to factors in a data
frame. You want to preserve your tickers as characters, so typically you
need to specify something like:
imp <- read.csv("xyz.csv", stringsAsFactors=FALSE, headers = TRUE)
otherwise your frame of tickers will be of type factor rather than string
assuming you have some structure in the csv like:
row 1: |ticker|
--------
row 2 |SPY US Equity|
--------
I suspect (though Dirk et al could confirm) that you're getting the
'expecting a string vector' error as you're not passing a character vector
to bdp
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list