View source: R/equals_na_linter.R
equals_na_linter | R Documentation |
Check for x == NA
, x != NA
and x %in% NA
. Such usage is almost surely incorrect –
checks for missing values should be done with is.na()
.
equals_na_linter()
common_mistakes, correctness, default, robustness
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "x == NA",
linters = equals_na_linter()
)
lint(
text = "x != NA",
linters = equals_na_linter()
)
lint(
text = "x %in% NA",
linters = equals_na_linter()
)
# okay
lint(
text = "is.na(x)",
linters = equals_na_linter()
)
lint(
text = "!is.na(x)",
linters = equals_na_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.