New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mikmart opened this Issue Mar 7, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@mikmart
Copy link
Contributor

mikmart commented Mar 7, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment