weighted.mean: Compute the weighted mean
Description
Given a vector of values and a vector of weights, compute the
weighted mean
Usage
weighted.mean(x, w, na.rm = FALSE)
Arguments
- x
The vector of values
- w
The vector of weights
- na.rm
if TRUE
, only consider elements of x
that are not missing
(and their corresponding entries in w
). Defaults to FALSE
.