file.show
Display Files

Description

Displays one or more files. The function page() is used to display the files.

Usage

file.show(..., header = rep("", nfiles), title = "R Information", 
    delete.file = FALSE, pager = getOption("pager"), encoding = "") 

Arguments

... the character vectors containing the names of files to display.
header a character vector containing a header for each file in .... The length of this vector should equal the number files being displayed.
title a character string to be used as the overall title. The default is "R Information."
delete.file a logical value. If TRUE, then delete all files after displaying them. The default value is FALSE.
pager a character string naming the pager to use. The default is value of the pager option, options("pager"). The pager must be a program that can accept a file name as an argument. For more information, see the help file for page.

Details

This function displays the concatenation of the specified files with an optional header shown at the beginning of a file. This function is very similar to the page function, but it allows multiple files to be displayed.
This function emulates the R function file.show.
Value
returns the value returned by the call to page(), which is the exit status of the pager.
Side Effects
Files included in the ... arguments are deleted after being displayed if delete.file=TRUE.
See Also
page, file.exists, file.append.
Examples
# display the Copyright and VERSION files
# files <- c(file.path(getenv("SHOME"), c("Copyright", "VERSION")))
files <- file.path(R.home("doc"), c("COPYRIGHTS", "THANKS"))
file.show(files, header = c("--- Copyright ---",
    "--- THANKS ---"))

# display files using other pagers cat(file="LETTERS.txt", LETTERS, fill=40) cat(file="letters.txt", letters, fill=40) file.show("LETTERS.txt", "letters.txt", header = c("UPPERCASE", "lowercase")) file.show("LETTERS.txt", "letters.txt", header = c("UPPERCASE", "lowercase"), pager = "od --format xz") file.remove("LETTERS.txt", "letters.txt")

Package base version 4.0.0-28
Package Index