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

every() and NAs #174

Closed
kablag opened this Issue Feb 4, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@kablag

kablag commented Feb 4, 2016

I'm very impressed by purrr but from my point of view it's strange result:
every(NA, function(x) x > 0)
[1] FALSE
Doesn't it break R rules about NA?
Maybe it's better to return NA like all()?
all(c(NA) > 0)
[1] NA

@lionel-

This comment has been minimized.

Member

lionel- commented Feb 7, 2016

hmm yes, we should probably return NA if one element of .x is NA. And with some(), we should do the same except if one element is TRUE.

@hadley hadley added the bug label Mar 3, 2017

@hadley

This comment has been minimized.

Member

hadley commented Mar 3, 2017

library(purrr)
every(NA, ~ .x > 0)
#> [1] FALSE

@hadley hadley closed this in b26029d Mar 4, 2017

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