#' This function will prevent infinite loop
#' We can define the runing time for each file
with_timeout <- function(expr, cpu, elapsed) {
expr <- substitute(expr)
envir <- parent.frame()
setTimeLimit(cpu = cpu,
elapsed = elapsed,
transient = TRUE)
on.exit(setTimeLimit(
cpu = Inf,
elapsed = Inf,
transient = FALSE
))
eval(expr, envir = envir)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.