View source: R/commas_linter.R
commas_linter | R Documentation |
Check that all commas are followed by spaces, but do not have spaces before them.
commas_linter(allow_trailing = FALSE)
allow_trailing |
If |
configurable, default, readability, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "switch(op , x = foo, y = bar)",
linters = commas_linter()
)
lint(
text = "mean(x,trim = 0.2,na.rm = TRUE)",
linters = commas_linter()
)
lint(
text = "x[ ,, drop=TRUE]",
linters = commas_linter()
)
lint(
text = "x[1,]",
linters = commas_linter()
)
# okay
lint(
text = "switch(op, x = foo, y = bar)",
linters = commas_linter()
)
lint(
text = "switch(op, x = , y = bar)",
linters = commas_linter()
)
lint(
text = "mean(x, trim = 0.2, na.rm = TRUE)",
linters = commas_linter()
)
lint(
text = "a[1, , 2, , 3]",
linters = commas_linter()
)
lint(
text = "x[1,]",
linters = commas_linter(allow_trailing = TRUE)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.