timriffe / DemoTools

Tools for the evaluation, adjustment, and standardization of demographic data
https://timriffe.github.io/DemoTools
Other
59 stars 31 forks source link

Minimal reproducible example works! #271

Closed timriffe closed 1 year ago

timriffe commented 1 year ago

In this commit (not a complete list): 1) We have slightly adjusted the roxxygen documentation. In raticular the mlt_family argument, so that it match the values provided in the function. Also we added the description for mlt_input dataframe and adjusted the imports argument. 2) The possibility for using more than one family method was removed from the main function. 3) Where applicable the generic if statements were changed for stopifnot calls. 4) The groupAges functions were adjusted accordingly (BUT check issues below for some description). 5) All calls for the packages eg tidyr:: were removed where unambiguety of the call is valid. 6) In all function calls the arguments were changed for unambiguety. 7) Some code was cleaned, bugs fixed and typos were fixed. 8) Some unit tests were performed. 9) The description for the custom mlt_input_data was added. Columns, structure and etc. What was attempted but not done: 1) The change of ifelse pipe to lookup table in lt_ManualX_variable_r. The lookuptable version is commented. I think that the if else version looks more obvious and feels better. 2) Rounding as of now is kept as is.Rounding in most parts is done to robustely match the arguments, but sometimes for the sake of reproducibility of the old results. We have to decide weather we really need to dive into the code to unambiguously decide for each case what is what. 3) Ivan suggests us to disregards the HIV functions for now. As it is yet to be decided weather we want them at all. Chances are very high. they might be completely removed from the code. Ivan promised to do the corresponding changes when the decision will be made. Issues: I still am not completely sure aout the groupAges function. As of now, I keep the original version and comment out the groupAges. We might like to check it during the call.