View source: R/agg.wtd.quantile.R
agg.wtd.quantile | R Documentation |
Splits the data into subsets (according to the levels of a factor) and computes a weighted quantile for each
agg.wtd.quantile(x, by, weights = NULL, prob = 0.5, na.rm = FALSE)
x |
numeric vector or data frame of numeric vectors |
by |
factor used to split the data |
weights |
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used. |
prob |
a value between 0 and 1. Default is 0.5 (median) |
na.rm |
logical, indicating whether NA values should be silently removed before the computation proceeds. Default is FALSE. |
a data frame
Nicolas Robette
agg.wtd.mad
data(Movies)
agg.wtd.quantile(Movies[,c("Critics", "BoxOffice")], by = Movies$Country)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.