laplace <- function (logpost, mode, ...) {
  options(warn=-1)
  fit=optim(mode, logpost, gr = NULL, ..., hessian=TRUE,
            control=list(fnscale=-1))
  options(warn=0)
  mode=fit$par
  h=-solve(fit$hessian)
  p=length(mode)
  int = p/2 * log(2 * pi) + 0.5 * log(det(h)) +
    logpost(mode, ...)
  output = list(mode = mode, var = h, int = int, 
                converge=fit$convergence==0,
                logpost = logpost, n_inputs=nargs() - 2, ...)
  class(output) <- "posterior"
  return(output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.