-
Notifications
You must be signed in to change notification settings - Fork 991
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
fix tests for ties.method='last' to work on R 3.1 #4243
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4243 +/- ##
==========================================
+ Coverage 99.61% 99.61% +<.01%
==========================================
Files 72 72
Lines 13873 13874 +1
==========================================
+ Hits 13819 13820 +1
Misses 54 54
Continue to review full report at Codecov.
|
Very nice solution using I loooked at history and I couldn't find |
Ok I get a test fail too. Just in the second test (1369) with |
I did look at it briefly and yes I think NA is the issue
|
But the test sets the seed before the calls. Isn't it |
say the first element of the input is NA then frank will use the first random draw on an NA, while base::rank will not take any draws, so the random ordering will end up different IINM. I don't think we need to force exact consistency between rank and frank here -- random ordering should be random after all |
Yes both are random. But we may as well match base unless there's a reason not to. In this case it was easier to match base and turn the test on with 'random' included (thanks to your spot) so it could all be put to bed. Otherwise we'd have had to find another way to test random with na.last=NA. |
nice! I see the difference was only a few lines so yes that's preferred |
Follow up to #4242
ties.method='last'
only introduced on R 3.3 < 3.1, so the tests comparingbase::rank
tofrank
fail there.This approach shuts of
ties.method='last'
testing for R 3.1 (easiest solution).cc @jangorecki
PS anyone remember why we apparently shut off
ties.method='random'
testing? It was failing for me here, not sure why.