displayCode | R Documentation |
Displays the contents of a text file with line numbers and more.
## Default S3 method:
displayCode(con=NULL, code=NULL, numerate=TRUE, lines=-1, wrap=79, highlight=NULL,
pager=getOption("pager"), ...)
con |
A |
code |
A |
numerate |
If |
lines |
If a single |
wrap |
The (output) column |
highlight |
A |
pager |
If |
... |
Additional arguments passed to |
Returns (invisibly) the formatted code as a character
string.
Henrik Bengtsson
file.show
().
file <- system.file("DESCRIPTION", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file)
file <- system.file("NEWS.md", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file, numerate=FALSE, lines=100:110, wrap=65)
file <- system.file("NEWS.md", package="R.utils")
cat("Displaying: ", file, ":\n", sep="")
displayCode(file, lines=100:110, wrap=65, highlight=c(101,104:108))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.