.globals <- new.env(parent = emptyenv())
.globals$sessions <- NULL
amplpy <- NULL
#' @importFrom reticulate import
.onLoad <- function(libname, pkgname) {
amplpy <<- reticulate::import("amplpy", delay_load = TRUE)
}
.onUnload <- function(libpath) {
close_ampl_sessions()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.