This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/interactive.html
interactive {base}R Documentation

Is R Running Interactively?

Description

Return TRUE when R is being used interactively and FALSE otherwise.

Usage

interactive()

See Also

source, .First

Examples

 .First <- function() if(interactive()) x11()

[Package base version 2.9.0 ]