R/zzz.R

Defines functions .onLoad

.onLoad <- function(libname, pkgname) {

  mappings <- list(
    "R_PACKRAT_DEFAULT_LIBPATHS" = .libPaths(),
    "R_PACKRAT_SYSTEM_LIBRARY"   = .Library,
    "R_PACKRAT_SITE_LIBRARY"     = .Library.site
  )

  enumerate(mappings, function(key, val) {
    if (is.na(Sys.getenv(key, unset = NA)))
      setenv(key, val)
  })

  renv$initialize()

}

Try the packrat package in your browser

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

packrat documentation built on Sept. 8, 2023, 5:44 p.m.