Test For Interactive Execution of S-PLUS

DESCRIPTION:
Returns a logical value stating whether S-PLUS is being used interactively or in batch mode.

USAGE:
interactive()

VALUE:
a logical value: TRUE if the input to S-PLUS is an interactive terminal, FALSE if it is not.

DETAILS:
Use interactive to prevent inappropriate execution. For example, the menu and browser functions only work when executed interactively.

interactive is TRUE if and only if both the standard input and standard error file descriptors are terminals (as determined by the isatty system routine). This is not foolproof.


SEE ALSO:
menu , browser .

EXAMPLES:
if(!interactive()) stop("must be interactive")