quit(save="ask") q(save="ask") .Last <- function(x) { ...... }
save
| a character string indicating whether the environment (workspace) should be saved. |
quit
or its alias q
terminate the current R
session.
save
must be one of "no"
, "yes"
,
or "ask"
.
In the first case the workspace is not saved, in the second
it is saved and in the third the user is prompted and can also decide
not to quit.
Immediately before terminating, the function .Last()
is
executed if it exists.
.First
for setting things on startup..Last <- function() { cat("Now printing PostScript graphic:\n") system("lpr Rplots.ps") cat("bye bye...\n") } ## Not really: quit("yes")