Prints a median with interquartile range.

nice_median(x, digits = 1)

Arguments

x

A numeric vector

digits

The number of digits to which values will be rounded

Value

A median with interquartile range in brackets

Examples

data(mtcars)
nice_median(mtcars$cyl)
#> [1] "6 (IQR:4-8)"