R/auto_clean.R

Defines functions auto_clean

auto_clean <- function(paths) {
  force(paths)

  env <- new.env(parent = emptyenv())
  reg.finalizer(env, onexit = TRUE, function(e) {
    try(unlink(paths, recursive = TRUE), silent = TRUE)
  })

  env
}

Try the rcmdcheck package in your browser

Any scripts or data that you put into this service are public.

rcmdcheck documentation built on Sept. 27, 2021, 5:13 p.m.