r-lib/withr

`withr::local_`: error `could not find function` when `withr` is not attached

Closed this issue · 0 comments

This might be similar to #123.

foo <- function() {
  withr::local_(setwd)(".")
}
foo()
#> Error in defer(setwd(old), envir = .local_envir): could not find function "defer"

Created on 2022-08-12 by the reprex package (v2.0.1)