Formatted Quantile Range
A function to calculate and format a quantile range.
fmt_quantile_range(x, format = "%.1f", sep = "-", lower = 0.25, upper = 0.75)
x |
The input data vector or data frame column. |
format |
A formatting string suitable for input into the
|
sep |
The character to use as a separator between the two quantiles. |
lower |
The lower quantile range. Default is .25. |
upper |
The upper quantile range. Default is .75. |
By default, the function calculates the 1st and 3rd quantiles at .25 and .75.
The upper and lower quantile ranges may be changed with the upper
and lower parameters.
The formatted quantile range.
Other helpers:
fmt_cnt_pct(),
fmt_mean_sd(),
fmt_median(),
fmt_n(),
fmt_range()
# Create example vector v1 <- c(4.3, 3.7, 8.7, 6.1, 9.2, 5.6, NA, 0.7, 7.8, 4.9) # Format Quantiles fmt_quantile_range(v1) # Output # "4.3 - 7.8"
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.