R/zzz.R

Defines functions .onUnload .onLoad

#set option for verbose
.onLoad <- function(libname, pkgname) {
  op <- options()
  op.healthdb <- list(
    healthdb.verbose = TRUE,
    healthdb.force_proceed = FALSE
  )
  toset <- !(names(op.healthdb) %in% names(op))
  if (any(toset)) options(op.healthdb[toset])

  invisible()
}

#clean up
.onUnload <- function(libpath) {
  op <- options()
  op.healthdb <- list(
    healthdb.verbose = NULL,
    healthdb.force_proceed = NULL
  )
  toremove <- names(op.healthdb) %in% names(op)
  if (any(toremove)) options(op.healthdb[toremove])

  invisible()
}

Try the healthdb package in your browser

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

healthdb documentation built on May 29, 2024, 8:57 a.m.