View source: R/txt_median_iqr.R
txt_median_iqr | R Documentation |
Summary text functions for html tables
txt_median_iqr(var, lower = 0.25, upper = 0.75, na.rm = T, digits = 1, ...)
var |
A vector, or variable name within a dataframe |
lower |
For quantile functions, the lower quantile (0.25 default) |
upper |
For quantile functions, the upper quantile (0.75 default) |
na.rm |
a logical value indicating whether NA values should be stripped |
... |
passes to 'median(...)' |
A character vector with median (interquartile range), suitable for printing in an html table
sprintf
, median
, quantile
library(dplyr)
txt_median_iqr(mtcars$mpg)
mtcars %>%
group_by(cyl) %>%
summarise(mean_mpg = txt_mean_range(mpg))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.