Display the contents of a file to the R console

Description

Display the contents of a file to the R console

Usage

1
more(file, n = -1, display = c("all", "head", "tail"))

Arguments

file

Text string giving the file name

n

Integer specifying the maximum number of lines to read from the file. This is passed to the n argument of readLines. The default is -1, which will read all the lines in the file.

display

Text string that uniquely identifies one of "all", "head", or "tail". Defaults to "all", which causes all lines read from the file to be displayed, "head" shows the first 6 lines that were read, and "tail" shows the last 6 lines that were read.

Value

Returns nothing, but it does display the contents of the file on the R console.

Author(s)

Landon Sego

See Also

readLines

Examples

1
2
3
4
cat("Here's a file\n", "with a few lines\n",
    "to read.\n", sep = "", file = "tmpFile.txt")
more("tmpFile.txt")
unlink("tmpFile.txt")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.