# will produce lints
lint(
text = "x[x == '']",
linters = nzchar_linter()
)
lint(
text = "x[nchar(x) > 0]",
linters = nzchar_linter()
)
# okay
lint(
text = "x[!nzchar(x, keepNA = TRUE)]",
linters = nzchar_linter()
)
lint(
text = "x[nzchar(x, keepNA = TRUE)]",
linters = nzchar_linter()
)
Run the code above in your browser using DataLab