interactive
Test For Interactive Execution

Description

Returns a logical value stating whether the engine is being used interactively or in batch mode.

Usage

interactive()

Details

Use interactive to prevent inappropriate execution. For example, the menu and browser functions work only when executed interactively.
interactive returns TRUE if the engine is started interactively, without using the -e or -f options, and if the standard input is a terminal (as determined by the isatty function).
(interactive returns TRUE if the engine is started with the --interactive option, Even if these are not true.)
Value
a logical value: TRUE if the engine is being used interactively, FALSE if it is not.
See Also
menu, browser, isatty.
Examples
if(!interactive()) stop("must be interactive") 
Package base version 6.1.1-7
Package Index