showSpecialMessage <- function(...,envir=parent.frame()){
temp <- tempfile()
nullcon <- file(temp, open = "wb")
sink(nullcon, type = "message")
expr <- substitute(...)
tryCatch(eval(expr,envir = envir),
error=function(e) list(error=conditionMessage(e))) |>
suppressWarnings()
sink(type = "message")
close(nullcon)
msg <- readLines(temp,encoding = 'UTF-8')
unlink(temp)
msg
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.