# on.exit() for arbitrary parent frames
defer <- function(expr, envir = parent.frame()) {
call <- substitute(
base::evalq(expr, envir = envir),
list(expr = substitute(expr), envir = parent.frame())
)
do.call(base::on.exit, list(call, add = TRUE), envir = envir)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.