View source: R/implicit_integer_linter.R
implicit_integer_linter | R Documentation |
Check that integers are explicitly typed using the form 1L
instead of 1
.
implicit_integer_linter(allow_colon = FALSE)
allow_colon |
Logical, default |
best_practices, configurable, consistency, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "x <- 1",
linters = implicit_integer_linter()
)
lint(
text = "x[2]",
linters = implicit_integer_linter()
)
lint(
text = "1:10",
linters = implicit_integer_linter()
)
# okay
lint(
text = "x <- 1.0",
linters = implicit_integer_linter()
)
lint(
text = "x <- 1L",
linters = implicit_integer_linter()
)
lint(
text = "x[2L]",
linters = implicit_integer_linter()
)
lint(
text = "1:10",
linters = implicit_integer_linter(allow_colon = TRUE)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.