| dir.create(empty_wd) | dir.create(empty_wd) | ||||
| owd <- setwd(empty_wd) | owd <- setwd(empty_wd) | ||||
| on.exit({setwd(owd); unlink(empty_wd, TRUE)}) | on.exit({setwd(owd); unlink(empty_wd, TRUE)}) | ||||
| callr::r_safe(.f, args) | |||||
| args$.f <- .f | |||||
| res <- callr::r_safe(function(.f, ...) { | |||||
| tryCatch( | |||||
| list(result = .f(...), error = NULL), | |||||
| error = function(e) list(result = NULL, error = e$message) | |||||
| ) | |||||
| }, args) | |||||
| if (!is.null(res$error)) { | |||||
| stop(res$error) | |||||
| } else { | |||||
| res$result | |||||
| } | |||||
| } | } |
| options(warn = 2) | options(warn = 2) | ||||
| xaringanthemer::style_xaringan(text_color = "rgb(100, 100, 100)", background_color = "white", outfile = NULL) | xaringanthemer::style_xaringan(text_color = "rgb(100, 100, 100)", background_color = "white", outfile = NULL) | ||||
| }), | }), | ||||
| regexp = "Colors.+used by.+theme_xaringan", | |||||
| class = "callr_status_error" | |||||
| regexp = "Colors.+used by.+theme_xaringan" | |||||
| ) | ) | ||||
| }) | }) |