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

cumany and missing values #408

Closed
hadley opened this issue Apr 26, 2014 · 3 comments
Closed

cumany and missing values #408

hadley opened this issue Apr 26, 2014 · 3 comments
Assignees
Labels

Comments

@hadley
Copy link
Member

@hadley hadley commented Apr 26, 2014

cumany()/cumall() should always be NA after the first NA is seen. Currently:

cumany(c(NA, NA, NA))
# [1]   NA TRUE TRUE
cumall(c(NA, NA, NA))
# [1] NA TRUE TRUE
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Jun 11, 2014

Hmm. What should happen if the NA appears where we already know the final answer:

cumall( c(FALSE, FALSE, NA, TRUE)  )
cumany( c(TRUE, TRUE, NA, FALSE ) )

Those should be all FALSE and all TRUE IMO. So in cumany as soon as we see TRUE or NA we know everything, and same in cumall as soon as we see NA or FALSE.

@hadley
Copy link
Member Author

@hadley hadley commented Jun 11, 2014

Right - they should follow what R does - TRUE || NA is TRUE.

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Jun 11, 2014

Cool. Closing this then :)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants