Skip to content

make fifelse(test, yes, no, na)  #3753

Closed

Description

@shrektan

(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?

Activity

  1. jangorecki commented on Aug 9, 2019

    @jangorecki
    Member

    I think it is good idea, and shouldn't add any overhead. Maybe only for double requires extra check for NaN.

  2. 2005m commented on Aug 9, 2019

    @2005m
    Contributor

    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?

  3. jangorecki commented on Aug 9, 2019

    @jangorecki
    Member

    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.

  4. 2005m commented on Aug 31, 2019

    @2005m
    Contributor

    Hello, just saw that #3741 has been reviewed. Where would you like me to commit changes for feature request #3753 ? Thanks.

  5. added this to the 1.12.4 milestone on Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions