View source: R/rep_median_iqr.R
rep_median_iqr | R Documentation |
Reporting helper function: computes and formats median and interquartile range from a numeric vector.
rep_median_iqr(
x,
digits = 2,
na.rm = TRUE,
collapse = "to",
iqr_brackets = c("round", "square"),
iqr_prefix = TRUE
)
x |
A numeric vector. |
digits |
An integer indicating the number of decimal places. |
na.rm |
A logical indicating if missings should be removed from |
collapse |
A character which is placed between the lower and the upper confidence bound in the formatted output. |
iqr_brackets |
A character. Either |
iqr_prefix |
A logical. If |
This is just a special case of rep_median_ci()
with the parameter
conf_int
set to 50
.
A character with the formatted output.
rep_median_ci()
set.seed(123)
x <- rnorm(1000)
rep_median_iqr(x)
rep_median_iqr(rep(1, 10))
rep_median_iqr(x, collapse = "-")
rep_median_iqr(x, iqr_brackets = "square")
rep_median_iqr(x, iqr_brackets = "square", iqr_prefix = FALSE)
rep_median_iqr(x, collapse = ";", iqr_prefix = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.