-
Notifications
You must be signed in to change notification settings - Fork 1k
fix variable with melt(measure.vars=list), na.rm=T/F consistency #4723
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4723 +/- ##
==========================================
+ Coverage 99.42% 99.43% +0.01%
==========================================
Files 73 73
Lines 14466 14460 -6
==========================================
- Hits 14383 14379 -4
+ Misses 83 81 -2
Continue to review full report at Codecov.
|
|
hi again @mattdowle this is a pretty simple fix, any chance you could review and consider including in next release? |
|
hi again @mattdowle @arunsrinivasan please consider merging this simple fix for melt for the next release, thanks! (sorry if I'm being annoying, I know there are a lot of other PRs to examine, I just wanted to make clear that my suggestion for prioritizing my melt-related PRs should be first this one, then #4720, then #4731, then #4737) |
Closes #4455
hi @jangorecki tagging you for a review since this is a fix for #4455 which you labeled.
Turns out the fix was really easy, just had to delete two lines of code.
I had to update the expected values for two existing tests, which I suspect were created based on the empirical output of melt, rather than the theoretically expected values.
In the linked issue the example code which illustrates the problem is:
on current master we get results that are inconsistent (na.rm=TRUE gives variable=1, but na.rm=FALSE gives variable=2).
This is problematic for downstream applications such as tdhock/nc#11 which need variable to be the corresponding index of the measure.vars list elements. In the example above we need variable=2 in both cases so that we know the data come from child2.
After applying this PR I get
All tests pass on my computer (R-4.0.2, Ubuntu 18.04), please code review.