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 upmake fifelse(test, yes, no, na) #3753
Comments
|
I think it is good idea, and shouldn't add any overhead. Maybe only for double requires extra check for NaN. |
|
Yes I can suggest something and NaN are dealt with. Shall I do a pull request or shall I wait for @jangorecki PR #3740 first? |
|
Generally it would be fine to push it to the same PR branch so we can deal with conflicts easily, but I feel we might need to revert some of my chances there, so probably better to wait for @mattdowle to review #3741 first. |
(I've comment in #3740 (comment). After a second though, I think it's better to open a new issue ticker but feel free to close it if it regards as duplicated)
Just tried the new
fifelse(), fantastic!However, I like the choice that
dplyr::if_else()made - has an additional argument namedmissing.It's because in R, the logic scalar may have three different values,
TRUE,FALSEandNA.Currently,
fifelse()returnsNAfor testNA, I think it very good. But it may be better if we can have a function with an additional argumentnalike this:Is it a good idea?