[R-sig-finance] Is there an R-analog of S-Plus's import.dta.bloomberg?

Dirk Eddelbuettel edd at debian.org
Wed Oct 20 16:10:02 CEST 2004


On Wed, Oct 20, 2004 at 09:24:40AM -0400, Andrew Piskorski wrote:
> On Mon, Oct 18, 2004 at 04:04:20PM -0500, Dirk Eddelbuettel wrote:
> > On Mon, Oct 18, 2004 at 03:47:33PM -0500, davidr at rhotrading.com wrote:
> 
> > > I realize that Bloomberg is expensive so few will have access to it, but
> > > being able to get Bloomberg data directly into R would be very useful
> > > (as it has been in S-Plus.)
> > 
> > Sure is. I wrote a package for it against the (rather well documented)
> > Bloomberg C API -- try WAPI <Go> and look for the 'C SDK' under downloads.
> 
> The Bloomberg C API is reasonably well documented, but it is also
> quite low level, so it NEEDS to be.  For anyone going that route, my
> advice is to pay careful attention to the dozen or so example C
> programs Bloomberg provides, as they are ugly, but CORRECT.
> 
> Whenever you encounter subtle correctness or performance bugs in your
> code, look again at Bloomberg's examples.  Often you will see that
> they are doing something in one particular way which happens to work
> well, even though the API docs don't seem to require that you do it
> exactly that way.  Basically, the Bloomberg C API docs are helpful but
> do not fully specify how you need to use it.  The C examples do.

Excellent points and very true -- my presentation didn't stress that as much
as it could have. The informal algorithm was

- for a given access style, pick the corresponding example C file
- prune the code, and refactor some recurrent code into a utility library
- try it in repeated calls from a simple main()
- wrap the R-style interface around it and disable main()

As Andrew says, their examples work, though they are not the most elegant
code I've ever seen, and there is a pretty obscure call pattern from one
function down to another and another ... for a rather large total. But it
*works*, and given a Bloomberg terminal, one can alter these.

I still haven't found a good way to initiate a conversation with my boss(es)
about why "we should give something away for free". I do of course have my
views on that, but need something more convincing. I'd love to hear, on or
off list, from anybody with a template they could share.

Dirk

-- 
Those are my principles, and if you don't like them... well, I have others.
                                                -- Groucho Marx



More information about the R-sig-finance mailing list