more: Display the contents of a text file to the R console

Description Usage Arguments Value Author(s) See Also Examples

View source: R/more.R

Description

Display the contents of a text 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")

Example output

Here's a file
with a few lines
to read. 

Smisc documentation built on May 2, 2019, 2:46 a.m.