stopifnot_all_linter | R Documentation |
stopifnot(A)
actually checks all(A)
"under the hood" if A
is a vector,
and produces a better error message than stopifnot(all(A))
does.
stopifnot_all_linter()
best_practices, readability
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "stopifnot(all(x > 0))",
linters = stopifnot_all_linter()
)
lint(
text = "stopifnot(y > 3, all(x < 0))",
linters = stopifnot_all_linter()
)
# okay
lint(
text = "stopifnot(is.null(x) || all(x > 0))",
linters = stopifnot_all_linter()
)
lint(
text = "assert_that(all(x > 0))",
linters = stopifnot_all_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.