| interactive | R Documentation |
ReturnTRUE whenR is being used interactively andFALSE otherwise.
interactive()
An interactiveR session is one in which it is assumed that there isa human operator to interact with, so for exampleR can prompt forcorrections to incorrect input or ask what to do next or if it is OKto move to the next plot.
GUI consoles will arrange to startR in an interactive session. WhenR is run in a terminal (viaRterm.exe on Windows), itassumes that it is interactive if ‘stdin’ is connected to a(pseudo-)terminal and not if ‘stdin’ is redirected to a file orpipe. Command-line options--interactive (Unix) and--ess (Windows,Rterm.exe) override the defaultassumption.(On a Unix-alike, whether thereadline command-line editor isused isnot overridden by--interactive.)
Embedded uses ofR can set a session to be interactive or not.
Internally, whether a session is interactive determines
how some errors are handled and reported, e.g. seestop andoptions("showWarnCalls").
whether one of--save,--no-save or--vanilla is required, and ifR ever asks whether to save theworkspace.
the choice of default graphics device launched when needed andbydev.new: seeoptions("device")
whether graphics devices ever ask for confirmation of a newpage.
In addition,R's ownR code makes use ofinteractive(): forexamplehelp,debugger andinstall.packages do.
This is a primitive function.
source,.First
.First <- function() if(interactive()) x11()
Add the following code to your website.
For more information on customizing the embed code, readEmbedding Snippets.
