[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  file.show: Display One or More Text Files

##  Description

Display one or more (plain) text files, in a platform specific way, typically
via a ‘pager’.

##  Usage

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

##  Arguments

…

one or more character vectors containing the names of the files to be
displayed. Paths with have [ tilde expansion
](/link/tilde%20expansion?package=base&version=3.6.2) .

header

character vector (of the same length as the number of files specified in ` … `
) giving a header for each file being displayed. Defaults to empty strings.

title

an overall title for the display. If a single separate window is used for the
display, ` title ` will be used as the window title. If multiple windows are
used, their titles should combine the title and the file-specific header.

delete.file

should the files be deleted after display? Used for temporary files.

pager

the pager to be used: not used on all platforms

encoding

character string giving the encoding to be assumed for the file(s).

##  Details

This function provides the core of the R help system, but it can be used for
other purposes as well, such as ` [ page
](/link/page?package=base&version=3.6.2) ` .

How the pager is implemented is highly system-dependent.

The basic Unix version concatenates the files (using the headers) to a
temporary file, and displays it in the pager selected by the ` pager `
argument, which is a character vector specifying a system command (a full path
or a command found on the ` PATH ` ) to run on the set of files. The ‘factory-
fresh’ default is to use ` R_HOME/bin/pager ` , which is a shell script
running the command-line specified by the environment variable ` PAGER ` whose
default is set at configuration, usually to ` less ` . On a Unix-alike ` more
` is used if ` pager ` is empty.

Most GUI systems will use a separate pager window for each file, and let the
user leave it up while  R  continues running. The selection of such pagers
could either be done using special pager names being intercepted by lower-
level code (such as ` "internal" ` and ` "console" ` on Windows), or by
letting ` pager ` be an  R  function which will be called with arguments `
(files, header, title, delete.file) ` corresponding to the first four
arguments of ` file.show ` and take care of interfacing to the GUI.

The ` R.app ` GUI on macOS uses its internal pager irrespective of the setting
of ` pager ` .

Not all implementations will honour ` delete.file ` . In particular, using an
external pager on Windows does not, as there is no way to know when the
external application has finished with the file.

##  See Also

` [ files ](/link/files?package=base&version=3.6.2) ` , ` [ list.files
](/link/list.files?package=base&version=3.6.2) ` , ` [ help
](/link/help?package=base&version=3.6.2) ` ; ` [ RShowDoc
](/link/RShowDoc?package=base&version=3.6.2) ` call ` file.show() ` for ` type
= "text" ` . Consider ` [ getOption
](/link/getOption?package=base&version=3.6.2) ("pdfviewer") ` and e.g., ` [
system ](/link/system?package=base&version=3.6.2) ` for displaying pdf files.

` [ file.edit ](/link/file.edit?package=base&version=3.6.2) ` .

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2Ffile.show&utm_source=r-docs&utm_medium=docs&utm_term=file.show&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {
    file.show(file.path(R.home("doc"), "COPYRIGHTS"))
    # }
    

Run the code above in your browser using  [ DataCamp Workspace
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=pac