R/zzz.R

Defines functions .onLoad .onAttach

.onAttach <- function(libname, pkgname) {
  packageStartupMessage("Checking Boosted Ensemble model...")

  tryCatch({
    # Obtain the model from the downloading function
    download_model()

    # Assign the model to the package namespace
    # assign("BE_model_unbundled", model, envir = asNamespace(pkgname))
    # packageStartupMessage("Model loaded and assigned to package namespace.")
  }, error = function(e) {
    warning("Failed to load model: ", e$message)
  })
}

.onLoad <- function(libname, pkgname) {
  # This is added so that themodel is available when using the package
  # It's not necessary to reload, as it was done with .onAttach

}

Try the imanr package in your browser

Any scripts or data that you put into this service are public.

imanr documentation built on April 13, 2025, 5:12 p.m.