Skip to contents

Check that the c() function is not used without arguments nor with a single constant.


unneeded_concatenation_linter(allow_single_expression = TRUE)



Logical, default TRUE. If FALSE, one-expression usages of c() are always linted, e.g. c(x) and c(matrix(...)). In some such cases, c() is being used for its side-effect of stripping non-name attributes; it is usually preferable to use as.vector() to accomplish the same more readably.

See also

linters for a complete list of linters available in lintr.