taskStatus <- function(expr, to, msg="") {
if (!has_oauth_token())
stop("taskStatus requires OAuth authentication")
status <- try(expr, silent=TRUE)
if (inherits(status, "try-error")) {
out <- paste(paste("Your task failed with error message",
status), msg, ":")
dmSend(out, to)
}
else {
out <- paste("Your task has completed successfully",
msg, sep=":")
dmSend(out, to)
}
status
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.