-
Notifications
You must be signed in to change notification settings - Fork 21
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
pairwise_comparison() outputs both NA and NaN #140
Comments
Ah, I was so slow to post this issue that there is already a fix: #139. |
Good to have the problem laid out in detail, though - I chose to make everything For what it's worth the problem in our case was:
When saving to csv the second data table leads to a duplicated row. |
Hm wouldn't it be best to assign |
It has been changed after (but directly to |
ah. perfect! |
Reprex
Created on 2021-11-10 by the reprex package (v2.0.1.9000)
As you can see here, we have two almost identical lines for
EuroCOVIDhub-ensemble
excepted that one is withNA
and the other withNaN
. The fact that a model can have more than one row cause issues in downstream analyses in our cases.Description of the problem
It looks like
pairwise_comparison()
sometimes returnsNA
and sometimesNaN
when it cannot compute the value. This leads to confusion because bothNA
andNaN
indicate almost the same thing but they have strange incompatibilites:Created on 2021-11-10 by the reprex package (v2.0.1.9000)
Proposed solution
NaN
is rarely used and confusing (IMO). They often appear because the function doesn't control the output for errors/impossible computations. And they can cause serious issues in downstream analyses (such as in our case). Tomas Kalibera gives a good overview of the hell that isNA
vsNaN
:So we should stick to only one of these. As far as I know,
NA
always propagates asNA
whilef(NaN)
can returnNA
orNaN
depending onf()
so a conscious choice to always outputNA
would be much better / clearer IMO.The text was updated successfully, but these errors were encountered: