R/zzz.R

Defines functions .onDetach .onAttach

# this function is automatically called when the package is attached
# we use that to hack the R loaders unless inhibit_r_loaders_hack()
.onAttach <- function(libname, pkgname) {
  if (!inhibit_r_loaders_hack() && !is_loaders_hack_installed()) {
    srcpkgs::hack_r_loaders()
    packageStartupMessage('hacked R loaders (cf srcpkgs::hack_r_loaders()).')
  }
}

.onDetach <- function(libpath) {
  srcpkgs::unhack_r_loaders()
}

Try the srcpkgs package in your browser

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

srcpkgs documentation built on May 29, 2024, 6:43 a.m.