Open MartinHinz opened 7 years ago
As I was busy during your report on oxcAAR with mortAAR, I am not up to date... Anyway, perhaps I have an idea for output once I read the vignette.
Sorry, for not listening ; )
OK, going the other way round, what is in the object and what can potentially be extracted:
together with get, this might form a body of output functions. Not sure if name is relevant. So
What do you think? Enough, to much, or any idea about a derivative value that would benefit from an explicit function?
Ok - I still don't understand oxcAAR completely, so correct me if I'm wrong.
There are two main classes: oxcAARCalibratedDates and oxcAARCalibratedDatesList
The tidy output should be a data.frame. I suggest to prepare an output data.frame were one row represents one date. In case of the oxcAARCalibratedDates, the output data.frame respectively has one row, in case of the oxcAARCalibratedDatesList many.
These are the values in oxcAARCalibratedDates:
Strings and integers can go into the data.frame immediately, the list and the data.frame can be stored in list columns. That's how I would do it. D'accord?
Idea: We don't write an own tidy output function but prepare a pull request with one for the broom package. https://github.com/tidyverse/broom
Now I understand much better what you have in mind.
What about the following:
Benefits:
Costs:
get_tidy_oxcalresult()
should be part of 1.0. We tackle the broom::tidy()
implementation when oxcAAR 1.0 is on CRAN. Let's do it!
50 % reached with e4af8749a9e43f312384c41c16667145e5e9e493. Yeahh!
Now the get_tidy_oxcalresult()
function has to be implemented.
Returned to thinking about the usefulness of this... It would make it necessary to import "tibble", just for this purpose. Especially questionable, when we still want or need to implement a function at broom. So I changed my mind, and would vote for transfering all tidy functionalitity to our broom fork. What do you think?
I'm pretty confident that we don't need tibble for the basic implementation. Further on get_tidy_oxcalresult()
could already be structured more or less like the future tidy()
implementation. I'll give it a go this afternoon and you can decide afterwards if you like it, ja?
Sure, would have done that my self, but fine. But I still do not know how you will do that without the actual tibble format!? How put the data.frame of probabilities into a "data.frame" of a tidy structure!?
A normal dataframe also allows nested content. Do I miss something?
data.frame(
a = 1:3,
b = I(list(1,1:2,1:3)),
c = I(list(list(1,1:2,1:3), list(1,1:2,1:3), list(1,1:2,1:3))),
d = I(list(mtcars, mtcars, mtcars))
)
I'm still working on the getter functions, but eventually I'll get to it...
Right, damn, my ignorance. Was not aware of the I! OK, then it seems that I am looking forward to your solution!!
af2cc5c1ee817efc805e87b0baf3205bd9e25e0d. You're right - would be much more nice with tibble. But I think that'll do for the moment until we have a CRAN release and can take a look at broom.
Was not in the mood to write tests yet. Will do later.
Concerning the getter functions: Does the call to unname()
make sense?
https://www.youtube.com/watch?v=BHsSgxpX8rY
Thanks alot, could also do the tests if you like, let me know.
Unname absolutely makes sense!
Haha - nono I can write the tests. ;-)
Do you think it is ok to move this issue than to 1.1?
implement functions that extract informations from the resulting oxcAAR objects and present them in easily processible formats (vector, data frame)
Candidates are: