Display the contents of a text file to the R console
more(file, n = -1, display = c("all", "head", "tail"))
Text string giving the file name
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.
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.
Returns nothing, but it does display the contents of the file on the R console.
# NOT RUN { cat("Here's a file\n", "with a few lines\n", "to read.\n", sep = "", file = "tmpFile.txt") more("tmpFile.txt") unlink("tmpFile.txt") # }