## Keep parse data in non interactive sessions.
if (!interactive())
op <- options(keep.source = TRUE)
## Correct use of the 'c()' function
fil <- tempfile(fileext = ".R")
cat("x <- c(1, 2, 3, 4)", file = fil)
unneeded_concatenation_style(getSourceData(fil))
## Incorrect uses of the 'c()' function
fil <- tempfile(fileext = ".R")
cat("x <- c()",
"x <- c(42)",
file = fil, sep = "\n")
unneeded_concatenation_style(getSourceData(fil))
Run the code above in your browser using DataLab