Skip to content

if_else throws false must be a vector, not NULL. error for dplyr 1.1.0 #6730

@chrarnold

Description

@chrarnold

I posted an issue yesterday (#6728) but it was closed immediately after the first reply, which I felt was unjustified because my response and argument is not being replied to anymore because the issue is closed. I therefore would like to reopen it here again for a discussion, and I am hoping for a more fruitful solution.

Between dplyr 1.0.0 and 1.1.0, an undocumented (unless I oversaw it) and breaking change has been included into if_else that I find not very useful personally and which forced me and others to go back to base R ifelse, and I wanted to learn what was the motivation for it. In essence, it seems "The true and false arguments are always evaluated, regardless of whether their values are seen in the result, which causes an error in dplyr 1.1.0 when NULL is involved. I'd appreciate a discussion why this is a useful change, because it worked differently and "as expected" until dplyr 1.0.0. Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions