onGarbageCollect: Registers a function to be called when the R garbage...

onGarbageCollectR Documentation

Registers a function to be called when the R garbage collector is (detected to be) running

Description

Registers a function to be called when the R garbage collector is (detected to be) running.

Usage

## Default S3 method:
onGarbageCollect(fcn, action=c("prepend", "append", "replace"), ...)

Arguments

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.

Value

Returns (invisibly) the hooks successfully called.

Author(s)

Henrik Bengtsson

Examples

## Not run: 
  onGarbageCollect(function(...) {
    message("The R garbage collector is running!")
  })

## End(Not run)

R.utils documentation built on Nov. 18, 2023, 1:09 a.m.