
Last chance! 50% off unlimited learning
Sale ends in
"displayCode"(con=NULL, code=NULL, numerate=TRUE, lines=-1, wrap=79, highlight=NULL, pager=getOption("pager"), ...)
connection
or a character
string filename.
If code
is specified, this argument is ignored.TRUE
, line are numbers, otherwise not.numeric
where to wrap lines.vector
of line number to be highlighted."none"
, code is not displayed in a pager, but
only returned. For other options, see file.show
().file.show
(),
which is used to display the formatted code.character
string.
file.show
().
file <- system.file("DESCRIPTION", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file)
file <- system.file("NEWS", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file, numerate=FALSE, lines=100:110, wrap=65)
file <- system.file("NEWS", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file, lines=100:110, wrap=65, highlight=c(101,104:108))
Run the code above in your browser using DataLab