Learn R Programming

distionary (version 0.1.0)

range.dst: Range of Distribution

Description

Range returns a vector of length two, with the minimum and maximum values of the (support of the) distribution.

Usage

# S3 method for dst
range(distribution, ...)

Value

Vector of length two, containing the minimum and maximum values of a distribution.

Arguments

distribution

Distribution to compute range from.

...

Not used; vestige of the base::range() S3 generic.

Details

If there are no methods for the distribution's class, the range is calculated using eval_quantile() at 0 and at 1.

Examples

Run this code
a <- dst_gp(1, 0.5)
b <- dst_unif(0, 1)
c <- dst_norm(3, 4)
range(a)
range(b)
range(c)

Run the code above in your browser using DataLab