powered by
reg.finalizer(e, f, onexit = FALSE)
NULL
gc
Memory
f <- function(e) print("cleaning....") g <- function(x){ e <- environment(); reg.finalizer(e, f) } g() invisible(gc()) # trigger cleanup
Run the code above in your browser using DataLab