-
Notifications
You must be signed in to change notification settings - Fork 186
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 any_is_na_linter()
be extended to cover sum(is.na(x)) != 0L
?
#1575
Labels
Comments
I would put this is under our BooleanArithmeticLinter, which covers other
logical aggregations passed to sun() instead of any/all
…On Fri, Sep 30, 2022, 5:42 AM Indrajeet Patil ***@***.***> wrote:
It doesn't seem that uncommon
<https://github.com/search?q=%22sum%28is.na%22&type=code> of a pattern to
find NAs.
library(lintr)
x <- rep(c(TRUE, NA, FALSE, FALSE), 1000)
identical(
sum(is.na(x)) != 0L,
anyNA(x)
)#> [1] TRUE
# currently doesn't lint
lint(
text = "sum(is.na(x)) != 0L",
linters = any_is_na_linter()
)
Created on 2022-09-30 with reprex v2.0.2 <https://reprex.tidyverse.org>
—
Reply to this email directly, view it on GitHub
<#1575>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2BA5P74LSBP5EOIY5VZLLWA3NZ3ANCNFSM6AAAAAAQZXWK7M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I don't see Sounds good to me. |
I haven't been updating the list in #884 but we have developed a few more
in the meantime 😅
…On Fri, Sep 30, 2022, 10:53 AM Indrajeet Patil ***@***.***> wrote:
I don't see BooleanArithmeticLinter in #884
<#884>, but maybe it's not included
there.
Sounds good to me.
—
Reply to this email directly, view it on GitHub
<#1575 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2BA5OIIZZH5BSKHL7B6ODWA4SIHANCNFSM6AAAAAAQZXWK7M>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Subsuming this under #1580 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It doesn't seem that uncommon of a pattern to find
NA
s.Created on 2022-09-30 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: