- Notifications
You must be signed in to change notification settings - Fork82
Handle non finite edge cases with pluralization()#716
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
krlmlr left a comment
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.
Thanks! The commit suggestions are just ideas and by no means authoritative.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
gaborcsardi commentedAug 28, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Looks great, it is exactly the solution I had in mind. :D Thank you! |
This is a draft resolution to#701 and some related edge cases. The issue seems to be more general than originally described with handling any of the non-finite values (including NAs).
The currently implemented behavior is the following:
Numeric non-finite values (
NA_real_,NA_integer_,NaN,Infand-Inf) will be treated as aqty> 1 for pluralization purposes.Non-numeric NA values (
NA_character_andNA) are treated as a non-numeric input soqtyis based on the vector's length.I've opted not to throw an error for numeric
NAs orNaNcases since that seemed a bit severe but it also seems like a plausible outcome and happy to switch to that behavior if that is a better option.