Closed mtkerbeR closed 3 years ago
Oh, and my standard nag: can you please add a ChangeLog entry? Easy if you the One Editor Everybody Should Use (C-x 4 a
from a file adds a stub for the file), still possibly for all others :)
There is a bit of a hash here as you added your two commits to a stale checkout of our repo. Looking at your repo fork:
And a simple rebase did not work. So I pulled a rip cord and
I suggest we fold this PR and I open a replacement. It contains your two commits so you still get credit.
Edit: See branch https://github.com/Rblp/Rblpapi/tree/feature/334_redo
Thanks a lot for your work on this.
Unfortunately, I could not connect the computer running Bloomberg to github due to security reasons, hence tried to find another solution - a bad one. Will update the changelog from another computer later on - which will hopefully work without additional problems.
Sorry for the trouble caused - thanks a lot for your patience!
You should really keep a current checkout of our repo, either from a fresh fork or an updated pull. So I think I will just close this and open a new one. Your two commits are preserved and you get credit from them -- just not from this PR but a parallel one.
A first proposal of minor changes to code for function
bdh()
to return different types of objects - analogously togetTicks()
As this is one of my first contributions in R, please let me know about feedback/weaknesses of the proposed solutions, which I would be happy to take care of:
Two points worth mentioning:
a new Option
bdhType
is introduced, to allow for backward-compatibility. Alternative would be to useblpType
here as in getBars, however, if this value is set to a format which is not supported in bdh (likematrix
, which is feasible ingetBars
) existing code might break. This could be catched by extending possible values inmatch.arg(returnAs, c("data.frame", "fts", "xts", "zoo", "data.table"))
bygetOption("blpType")
, which would later on leads to a data.frame via the fallback option in switch if format is not supported.If some columns are non-numeric, types inheriting from zoo will convert numbers to characters for all columns (due to inheritance from
matrix
)The code could be (unit)tested as follows - adapting existing test cases for bdh to the case of different values for parameter
returnAs
: