## Keep parse data in non interactive sessions.
if (!interactive())
op <- options(keep.source = TRUE)
fil <- tempfile(fileext = ".R")
cat("x <- c(2, 3, 5)", "crossprod(2,", "x)",
"a <- array(1:24, 2:4)", "a[1, , ]",
file = fil, sep = "\n")
all_style(getSourceData(fil))
all_style(getSourceData(fil), include = c("commas", "nomagic"))
all_style(getSourceData(fil), include = c("commas", "nomagic"),
ignore.also = 5)
all_style(getSourceData(fil), exclude = "nomagic")
Run the code above in your browser using DataLab