R/zzz.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) {
  # The parsnip engines of specProc, and its simca model. parsnip is
  # suggested, so they are
  # registered now if parsnip is loaded, and otherwise when it is. A failure
  # must not stop parsnip from loading.
  register <- function(...) {
    engines <- list(rsimpls = register_pls_rsimpls, lts = register_linear_reg_lts,
                    mcd = register_discrim_mcd, rsimca = register_simca_rsimca)
    for (eng in names(engines)) {
      tryCatch(engines[[eng]](), error = function(e) {
        warning("specProc could not register the \"", eng, "\" parsnip engine: ",
                conditionMessage(e), call. = FALSE)
      })
    }
  }
  if (isNamespaceLoaded("parsnip")) register()
  setHook(packageEvent("parsnip", "onLoad"), register)
}

Try the specProc package in your browser

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

specProc documentation built on Nov. 20, 2026, 5:11 p.m.