Skip to contents

This function calculates the median(s) of a distribution, given as a ddf object. In the case of the median not being unique, by default all possible values are returned. This behaviour can be controlled using the methods argument.

Usage

medians(dist, method = "all")

Arguments

dist

A ddf object, the distribution.

method

A character specifying output format.

Value

A numeric vector.

Details

For details consult the details of quantile() and recall that a median is a \(\frac{1}{2}\)-quantile and vice versa.

Examples

# In case the mode is not unique, by default all
# possible modes are returned
medians(unif(4))
#> [1] 2 3
# This can be controlled using the method argument
medians(unif(4), method = "mean")
#> [1] 2.5