-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-factor functions to wrangle wfhz and muac data #57
Conversation
I have just made some changes in three files. I realised that my application of NSE was inconsistent; I had some lines of code where I had difused and tidy evaluated some arguments but I was simply not using them. So I fixed this in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomaszaba, see my detailed feedback below. I make suggestions. You decide if you want to follow them or not.
On testing, I did devtools::test_coverage_active_file()
when the test file for wrangle_muac is open and I note 5 lines of code note covered by testing. Please add test that cover these five lines of code.
@ernestguevarra, thanks for the review. I'll reflect on these and take the appropriate action. |
Hi @ernestguevarra,
Looking forward to your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomaszaba please merge to dev
or main
whichever one you want.
Ernest, in this PR I addressed issues #26 #27 #28. There were some tasks related to issues #24 #25. For these two I was not quite sure if you did not address them yet. Please let me know.
Now, onto the changes made and the rationale behind
utils.R
:In
flag_outliers() and
remove_flags()`:I changed class of the
@param x
fromdouble
tonumeric
due to the presence of the absolute MUAC values. In principle, if it was just WFHZ or MFAZ, it would be correct to saydouble
as they are. For MUAC at this stage, whenflag_muac()
is used/called, MUAC would have been set to millimetres; A MUAC in mm would be an integer. Thus, a middle point for both type of vectors would benumeric
.I changed the argument unit to
.from
as I believe it makes more sense like that. Maybe.in
could also make sense?In the choices, I changed "crude" to "absolute" to align with the use of absolute MUAC values in the documentation.
In
recode_muac()
:double
ornumeric
as I want to capture the fact that MUAC can come in centimeters or millimeters. For the latter, I tried to put integer but it fails as checking with either "is(x, "integer") or is.integer(x) fails (FALSE).Up to now, all functions inside
utils.R
are exported.mw_wrangle_muac()
I did not check if age is numeric or not. This is because:mw_wrangle_age()
mw_wrangle_age()
, which is an output that is checked in the tests..decimals
so user can control the number of decimal places for the zscorescharacter()
ornumeric()
, I think checking for this can be measleading as users can supplie any vector. You may say that this is what is in my docs, which is true, but later on in the docs I mention this specificity about thischaracter
ornumeric()
. To me, this is what I don’t think I should check for. happy to read your review though.On the general file organisation
.R
.Thanks