median2 | R Documentation |
Median as the 50th quantile with an option to select quantile algorithm
median2(x, type = 7, na.rm = FALSE)
q50(x, type = 7, na.rm = FALSE)
x |
numeric vector whose sample quantiles are wanted, or an
object of a class for which a method has been defined (see also
‘details’). |
type |
an integer between 1 and 9 selecting one of the nine quantile algorithms detailed below to be used. |
na.rm |
logical; if true, any |
q50
is an alias for median2
See stats::quantile()
stats::quantile()
set.seed(42)
x <- rnorm(100)
median(x) # 0.08979677
median2(x, type = 7) # 0.08979677 - default type is 7
median2(x, type = 3) # 0.08976065
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.