Page Through Data

DESCRIPTION:
Displays the input under the control of a paging program so that a long dataset or function or file will 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 then 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 argument, and should read from that file. If argument pager is omitted, the S-PLUS pager option is used. That option has a default value of less.
filename:
character string naming a file. If filename is given and x is not, then that file will be displayed a page at a time. If filename is omitted then x is required.
window:
logical flag: if TRUE, x or filename will be paged in its own window. This option is currently implemented only for X11-based window systems. For it to work, either display must be specified or the environment variable DISPLAY must be set, and the window system must be running.
display:
character string specifying which X11 server should receive the window. 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. Argument title is ignored if window=FALSE.
remove.file:
logical flag: if TRUE, filename will be removed after pager exits. This argument applies only when filename is given and x is not.

SIDE EFFECTS:
x or filename is displayed under the control of pager. If window=TRUE and all goes well, this happens in a new window, and page returns immediately; the S-PLUS session can then continue independent 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 sink, 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.

The default S-PLUS pager is less. This program uses commands similar to those in vi to move through the file - see the vi help file for a description of some of these commands. (Some of the vi commands work only in a forward direction in less.)


SEE ALSO:
print , browser , options .

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

EXAMPLES:
page(my.big.matrix)
page(auto.stats[1:30,], window=T, title="Concord to St. Regis")
page(myfun, window=T)    # look at function in sep. window
page(myfun(x, y))        # look at results in main window
page(get("%*%"), pager="view")    # page(%*%) wouldn't work
page(A %*% B, window=T, display="marlene:0.0")
        # supply display if $DISPLAY is not set
page(file="$SHOME/library/README")