R/distrSimOptions.R

Defines functions getdistrSimOption distrSimoptions

Documented in distrSimoptions getdistrSimOption

distrSimoptions <- function(...) {
  if (nargs() == 0) return(.distrSimoptions)
  current <- .distrSimoptions
  temp <- list(...)
  if (length(temp) == 1 && is.null(names(temp))) {
    arg <- temp[[1]]
    switch(mode(arg),
           list = temp <- arg,
           character = return(.distrSimoptions[arg]),
           stop("invalid argument: ", sQuote(arg)))
  }
  if (length(temp) == 0) return(current)
  n <- names(temp)
  if (is.null(n)) stop("options must be given by name")
  changed <- current[n]
  current[n] <- temp
  if (sys.parent() == 0) env <- asNamespace("distrSim") else env <- parent.frame()
  assign(".distrSimoptions", current, envir = env)
  invisible(current)
}

getdistrSimOption<-function(x)
distrSimoptions(x)[[1]]

Try the distrSim package in your browser

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

distrSim documentation built on Nov. 13, 2022, 1:07 a.m.