View source: R/any_is_na_linter.R
any_is_na_linter | R Documentation |
anyNA(x)
over any(is.na(x))
anyNA()
exists as a replacement for any(is.na(x))
which is more efficient
for simple objects, and is at worst equally efficient.
Therefore, it should be used in all situations instead of the latter.
any_is_na_linter()
best_practices, efficiency
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "any(is.na(x), na.rm = TRUE)",
linters = any_is_na_linter()
)
lint(
text = "any(is.na(foo(x)))",
linters = any_is_na_linter()
)
# okay
lint(
text = "anyNA(x)",
linters = any_is_na_linter()
)
lint(
text = "anyNA(foo(x))",
linters = any_is_na_linter()
)
lint(
text = "any(!is.na(x), na.rm = TRUE)",
linters = any_is_na_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.