(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 named missing.
It's because in R, the logic scalar may have three different values, TRUE, FALSE and NA.
Currently, fifelse() returns NA for test NA, I think it very good. But it may be better if we can have a function with an additional argument na like this:
fifelse(test, yes, no, na)
Is it a good idea?
(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?