powered by
Compute the weighted mean.
weightedMean(x, weights = NULL, na.rm = FALSE)
a numeric vector.
an optional numeric vector giving the sample weights.
a logical indicating whether missing values in x should be omitted.
x
The weighted mean of values in x is returned.
This is a simple wrapper function calling weighted.mean if sample weights are supplied and mean otherwise.
weighted.mean
mean
incMean
# NOT RUN { data(eusilc) weightedMean(eusilc$eqIncome, eusilc$rb050) # }
Run the code above in your browser using DataLab