medf | R Documentation |
The purpose of this function is to calculate the median, 25th and 75th percentiles of a numeric vector and format output as a string.
medf(x, digits = 2, na.rm = TRUE, ...)
x |
Numeric vector to summarize |
digits |
The number of decimal places to use; default is |
na.rm |
Boolean indicating whether or not |
... |
Additional arguments passed to formatC |
Note that the values for median, 25th, and 75th percentiles are calculated using fivenum.
Character vector of length 1 with formatted median followed by 25th,75th percentiles in parentheses:"median (25th,75th)"
. The formatting can be further customized using arguments to base::formatC
.
x <- sample(1:9, size = 100, replace = TRUE, prob = seq(0.9,0.1,-0.1)) medf(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.