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

T_and_F_symbol_linter() false positive with formula syntax #2637

Open
IndrajeetPatil opened this issue Jul 28, 2024 · 1 comment
Open

T_and_F_symbol_linter() false positive with formula syntax #2637

IndrajeetPatil opened this issue Jul 28, 2024 · 1 comment

Comments

@IndrajeetPatil
Copy link
Collaborator

library(lintr)
lint(
  text = "ivreg::ivreg(Q ~ P + D | D + F + A, data = Kmenta)", 
  linters = T_and_F_symbol_linter()
)
#> <text>:1:31: style: [T_and_F_symbol_linter] Use FALSE instead of the symbol F.
#> ivreg::ivreg(Q ~ P + D | D + F + A, data = Kmenta)
#>                              ~^

The F here corresponds to the column name:

data(Kmenta, package = "ivreg")
colnames(Kmenta)
#> [1] "Q" "P" "D" "F" "A"

Created on 2024-07-28 with reprex v2.1.1

@MichaelChirico
Copy link
Collaborator

should be safe to assume T/F are not TRUE/FALSE in the top-level of a formula, but not in calls like y~foo(x, arg=TRUE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants