empty_assignment_linter | R Documentation |
{}
Assignment of {}
is the same as assignment of NULL
; use the latter
for clarity. Closely related: unnecessary_concatenation_linter()
.
empty_assignment_linter()
best_practices, readability
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "x <- {}",
linters = empty_assignment_linter()
)
writeLines("x = {\n}")
lint(
text = "x = {\n}",
linters = empty_assignment_linter()
)
# okay
lint(
text = "x <- { 3 + 4 }",
linters = empty_assignment_linter()
)
lint(
text = "x <- NULL",
linters = empty_assignment_linter()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.