weighted_median | R Documentation |
Calculates weighted median based on weighted_quantile()
.
weighted_median(x, w = NULL, ...)
x |
Numeric vector. |
w |
Optional vector of non-negative case weights. |
... |
Further arguments passed to |
A length-one numeric vector.
weighted_quantile()
n <- 21
x <- seq_len(n)
quantile(x, probs = 0.5)
weighted_median(x, w = rep(1, n))
weighted_median(x, w = x)
quantile(rep(x, x), probs = 0.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.