displayCode {R.utils} | R Documentation |
Displays the contents of a text file with line numbers and more.
## Default S3 method: displayCode(con, numerate=TRUE, lines=-1, wrap=79, highlight=NULL, ...)
con |
A connection , a character string filename, or a character
vector (of length two or more) of source code. |
numerate |
If TRUE , line are numbers, otherwise not. |
lines |
If a single numeric , the maximum number of lines to show.
If -1, all lines are shown. If a vector of numeric , the lines
numbers to display. |
wrap |
The (output) column numeric where to wrap lines. |
highlight |
A vector of line number to be highlighted. |
... |
Not used. |
Returns nothing.
Henrik Bengtsson, http://www.braju.com/R/
file <- system.file("DESCRIPTION", package="R.utils") cat("-----------------------------------------------------------------\n") cat(file, ":\n", sep="") cat("-----------------------------------------------------------------\n") displayCode(file) cat("\n") file <- system.file("CONTENTS", package="R.utils") cat("-----------------------------------------------------------------\n") cat(file, ":\n", sep="") cat("-----------------------------------------------------------------\n") displayCode(file, numerate=FALSE, lines=100:110, wrap=65) cat("\n") file <- system.file("CONTENTS", package="R.utils") cat("-----------------------------------------------------------------\n") cat(file, ":\n", sep="") cat("-----------------------------------------------------------------\n") displayCode(file, lines=100:110, wrap=65, highlight=c(101,104:108))