displayCode {R.utils} | R Documentation |
Displays the contents of a text file with line numbers and more
Description
Displays the contents of a text file with line numbers and more.
Usage
## Default S3 method:
displayCode(con=NULL, code=NULL, numerate=TRUE, lines=-1, wrap=79, highlight=NULL,
pager=getOption("pager"), ...)
Arguments
con |
A |
code |
|
numerate |
If |
lines |
If a single |
wrap |
The (output) column |
highlight |
A |
pager |
If |
... |
Additional arguments passed to |
Value
Returns (invisibly) the formatted code as a character
string.
Author(s)
Henrik Bengtsson
See Also
file.show
().
Examples
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))
[Package R.utils version 2.12.3 Index]