# `lint_text()` is convenient to explore with a small example
lint_text("any(duplicated(rnorm(5)))")
lint_text("any(duplicated(rnorm(5)))
any(is.na(x))
")
# Setup for the example with `lint()`
destfile <- tempfile()
cat("
x = c(1, 2, 3)
any(duplicated(x), na.rm = TRUE)
any(duplicated(x))
if (any(is.na(x))) {
TRUE
}
any(
duplicated(x)
)", file = destfile)
lint(destfile)
Run the code above in your browser using DataLab