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, numerate=TRUE, lines=-1, wrap=79, highlight=NULL, ...)

Arguments

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.

Value

Returns nothing.

Author(s)

Henrik Bengtsson, http://www.braju.com/R/

Examples

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))


[Package R.utils version 0.5.5 Index]