This function calculates the interquartile range of a ddf distribution.
Details
The interquartile range is defined as the difference \(Q_3 - Q_1\), where
\(Q_1\) and \(Q_3\) are the first and third quartiles, respectively (for
more information see quartile() and quantile()).
This function always returns the largest possible interquartile range, i.e. if the third quartile is not unique, it uses the maximum of all third quartiles and if the first quartile is not unique, it uses the smallest one.
Examples
# Interquartile range of a uniform distribution
iqr(unif(10))
#> [1] 5
