Skip to content

Should predicate functions warn when called with a function that is not a predicate? #470

Description

@mikmart

Passing a function that returns a logical vector as the predicate argument to predicate functions can cause unexpected results, as in the example below, from this StackOverflow question.

purrr::every(list(1:10), is.na)
#> [1] TRUE

Perhaps adding a warning message if the predicate evaluates to a logical vector of length > 1 would be appropriate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions