Page Through Data

DESCRIPTION:

Displays the input under the control of a paging program so that a long dataset, function, or file does not scroll past on the screen.

USAGE:

page(x, pager=options()$pager, filename, window=F,  
     display=getenv("DISPLAY"), title=<<see below>>,  
     remove.file=F) 

OPTIONAL ARGUMENTS:

x
any S-PLUS object. If x is omitted, filename is required.
pager
character string naming a pager such as the UNIX programs more, pg, or view. The pager program is passed a file name as an argument, and should read from that file. If the pager argument is omitted, the S-PLUS pager option is used (i.e., options("pager")). That option has a default value of less.
filename
character string naming a file. If filename is given and x is not, the file will be displayed in the pager. If filename is omitted, x is required.
window
logical flag. If TRUE, x or filename is paged in its own window. This option is currently implemented only for X11-based window systems. For it to work, either the display argument must be specified or the environment variable DISPLAY must be set, and the window system must be running. By default, window=FALSE.
display
character string specifying which X11 server should receive the window. The argument window must be TRUE for this to have any effect. If window=TRUE and display is omitted, the DISPLAY environment variable is examined.
title
character string specifying a title for the X11 window. If missing, the title is taken from filename or x. The argument title is ignored if window=FALSE.
remove.file
logical flag. If TRUE, filename is removed after pager exits. This argument applies only when filename is given and x is not. By default, remove.file=FALSE.

SIDE EFFECTS:

x or filename is displayed under the control of pager. If window=TRUE and all goes well, this occurs in a new window and page returns immediately; the S-PLUS session can then continue independently of the paging window. If the window cannot be opened or if window=FALSE, the object is printed in the current window or screen and the session can resume only after the pager has exited.

NOTE:

This function uses , so it will wipe out a sink that is in effect.

DETAILS:

As with print, x may be any S-PLUS expression, not just object names. See the examples below for details.

The default S-PLUS pager is less. For a summary of commands you can use with less, type h in the less window.

SEE ALSO:

, , , .

BUGS:

The title on the new window will be wrong in obscure cases.

EXAMPLES:

page(quakes.bay)
page(auto.stats[1:30,], window=T, title="Concord to St. Regis") 
page(colMeans)                     # look at function in main window
page(colMeans(ethanol), window=T)  # look at results in sep. window
page(get("%*%"), pager="view")     # page(%*%) will not work 
page(file=paste(getenv("SHOME"), "/library/README", sep=""))