tests/testthat/helper-tempdir.R

withr_tempdir <- function(envir = parent.frame()) {
  dir <- tempfile("tok-test")
  dir.create(dir)
  do.call(on.exit, list(substitute(unlink(d, recursive = TRUE), list(d = dir)), add = TRUE), envir = envir)
  dir
}

Try the tokr package in your browser

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

tokr documentation built on Nov. 26, 2026, 5:08 p.m.