Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upfix 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::ranktofrankfail 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.