distroptions

0th

Percentile

function to change the global variables of the package `distr'

With distroptions you may inspect and change the global variables used by the package `distr'

Usage
distroptions(arg = "missing", value = -1)
Arguments
arg
the global variable to be shown or changed
value
the new value of the global variable
Value

  • distroptions() returns a list of the global variables. distroptions(arg=x) returns the global variable x. distroptions(arg=x,value=y) sets the value of the global variable x to y.

Aliases
  • distroptions
  • DefaultNrGridPoints
  • DistrResolution
  • TruncQuantile
  • DefaultNrFFTGridPointsExponent
  • RtoDPQ.e
Examples
distroptions("RtoDPQ.e") # returns the value of RtoDPQ.e, by default = 5
distroptions("RtoDPQ.e",6) # now RtoDPQ.e = 6

## The function is currently defined as
function (arg = "missing", value = -1) 
{
    globals <- list(DefaultNrFFTGridPointsExponent = DefaultNrFFTGridPointsExponent, 
        DefaultNrGridPoints = DefaultNrGridPoints, DistrResolution = DistrResolution, 
        RtoDPQ.e = RtoDPQ.e, TruncQuantile = TruncQuantile)
    if (arg == "missing") {
        print(globals)
        return(invisible())
    }
    if (!any(arg == names(globals))) 
        stop(paste("No such variable:", arg))
    if (value == -1) 
        switch(arg, DefaultNrGridPoints = DefaultNrGridPoints, 
            DistrResolution = DistrResolution, TruncQuantile = TruncQuantile, 
            DefaultNrFFTGridPointsExponent = DefaultNrFFTGridPointsExponent, 
            RtoDPQ.e = RtoDPQ.e)
    else eval.parent(parse(text = paste("assignInNamespace("", 
        arg, "",", value, ", "distr")", sep = "")))
  }
Documentation reproduced from package distr, version 1.5, License: GPL (version 2 or later)

Community examples

Looks like there are no examples yet.