Rblpapi
Rblpapi copied to clipboard
Integration of condition code support into getTicks
Here are my initial thoughts on integrating condition code support into getTicks. @eddelbuettel or anyone else interested in this, could you let me know your thoughts?
I think it would be useful to have options to:
- Return condition codes or not; and
- Filter ticks based on condition codes on the C++ side even if condition codes are not to be returned.
In terms of parameters and behavior:
- What about a named vector
options
which would include (amongst any other options) the optionsreturnAs
,setCondCodes
, and an option to filter to (or exclude) condition codes in a character vector? - If the returnAs option is set to
matrix
the function would always return only numeric data, and in that case condition codes would never be returned (although filtering ticks on condition codes would still work).
I would like to keep the interface as unchanged as possible.
And I think we can do that if we simply ... give a different meaning to setCondCodes
(maybe even call it getCondCodes
?): if it is set, return types requiring numbering representations (xts
, fts
, matrix
) are all rules out. So condCodes implies data.frame
.
As for the implementation, just make your core the default. For all other methods we convert the data.frame
before returning and drop the condCodes column.
Easier?
This sounds good to me. I will take this approach. Will look at this next week (hopefully).
I am going to pick this up as just discussed in #146 which I suggest we revert.