onSessionExit | R Documentation |
Registers a function to be called when the R session finishes.
## Default S3 method:
onSessionExit(fcn, action=c("prepend", "append", "replace"), ...)
fcn |
A |
action |
A |
... |
Not used. |
Functions registered this way are called when finalizeSession
() is
called. Moreover, when this package is loaded, the .Last()
function is modified such that finalizeSession()
is called.
However, note that .Last()
is not guaranteed to be called
when the R session finished. For instance, the user may quit R by
calling quit(callLast=FALSE)
.
Moreover, when R is run in batch mode, .Last()
is never called.
Returns (invisibly) the hooks successfully called.
Henrik Bengtsson
.Last()
.
finalizeSession
().
## Not run:
onSessionExit(function(...) {
message("Bye bye world!")
})
quit()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.