R/options.R

Defines functions .onLoad

#' @importFrom Rcpp loadModule Module
loadModule("dd_exponential")
loadModule("dd_logistic")

cur_load = if(exists(".onLoad()")) .onLoad else function() { NULL }
.onLoad <- function(libname, pkgname){
  cur_load()

  op <- options()

  # TODO: avoid this by doing as e.g., in `boot::boot` by using `getOption`
  op.dynhazard <- list(ddhazard_max_threads = 1)
  toset <- !(names(op.dynhazard) %in% names(op))
  if(any(toset))
    options(op.dynhazard[toset])

  invisible()
}

Try the dynamichazard package in your browser

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

dynamichazard documentation built on Oct. 6, 2022, 1:08 a.m.