View source: R/comparison_negation_linter.R
comparison_negation_linter | R Documentation |
!(x == y)
is more readably expressed as x != y
. The same is true of
other negations of simple comparisons like !(x > y)
and !(x <= y)
.
comparison_negation_linter()
consistency, readability
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "!x == 2",
linters = comparison_negation_linter()
)
lint(
text = "!(x > 2)",
linters = comparison_negation_linter()
)
# okay
lint(
text = "!(x == 2 & y > 2)",
linters = comparison_negation_linter()
)
lint(
text = "!(x & y)",
linters = comparison_negation_linter()
)
lint(
text = "x != 2",
linters = comparison_negation_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.