onSessionExit

0th

Percentile

Registers a function to be called when the R session finishes

Registers a function to be called when the R session finishes.

Usage
## S3 method for class 'default}(fcn, action=c("prepend", "append", "replace"), ...)':
onSessionExitundefined

fcn{A function to be called without argument.}
 action{A character string specifying how the hook function is
   added to list of hooks.}
 ...{Not used.}

Returns (invisibly) the hooks successfully called.

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 Rsession finished. For instance, the user may quit Rby calling quit(callLast=FALSE). Moreover, when Ris run in batch mode, .Last() is never called.
[object Object] onSessionExit(function(...) { cat("Bye bye world!\n"); }) quit() .Last(). finalizeSession(). programming
Aliases
  • onSessionExit.default
  • onSessionExit
Documentation reproduced from package R.utils, version 0.7.9, License: LGPL version 2.1 or newer (the releases)

Community examples

Looks like there are no examples yet.