Skip to contents

A class wrapping a single (or set) of parametrised distributions and provides access to the quantile, cumulative probability and random functions of that specific distribution. Parametrisation is handled on construction.

Usage

# S3 method for class 'character'
as.dist_fns(x, ...)

# S3 method for class '`function`'
as.dist_fns(x, ...)

# S3 method for class 'fitdist'
as.dist_fns(x, ...)

as.dist_fns(x, ...)

Arguments

x

a dist_fns S3 object

...

passed onto methods

Value

a dist_fns S3 object

Details

dist_fns and dist_fns_list objects support $ access for fields and @ access for attributes. dist_fns_lists can be made with the c() or rep() functions, or with the purrr style map functions, and they support subsetting. Individual dist_fns members of dist_fns_lists can be accessed with [[.

Methods (by class)

  • as.dist_fns(character): Construct a distribution by name

  • as.dist_fns(`function`): From a statistical function

  • as.dist_fns(fitdist): From a fitdistrplus::fitdist output

Unit tests



pois = as.dist_fns("pois",lambda = 8)
n = as.dist_fns("norm",mean=4)