Skip to contents

Get distribution functions

Usage

distfuncs(dist = "norm")

Arguments

dist

The target distribution function (e.g., norm, binom, gamma, truncnorm, likert). If the distribution isn't definited in the packages stats, truncnorm, or faux, use the format "package::dist".

Value

a list with the r and q functions

Examples

qfunc <- distfuncs("norm")$q # returns qnorm
p <- seq(0.1, 0.9, .1)
qfunc(p) == qnorm(p)
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

rfunc <- distfuncs("norm")$r # returns rnorm
rfunc(n = 10, mean = 100, sd = 10)
#>  [1] 105.04279 131.61267  91.05103 107.92766  89.09424  96.46497  98.35857
#>  [8]  90.80199  76.01096  91.18587