Skip to content
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
Labels
feature a feature request or enhancement map 🗺️

Comments

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

@hadley hadley added feature a feature request or enhancement map 🗺️ labels May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement map 🗺️
Projects
None yet
Development

No branches or pull requests

2 participants