powered by
Returns the weighted mean of a numeric vector. In contrast to stats::weighted.mean(), w does not need to be specified.
stats::weighted.mean()
w
weighted_mean(x, w = NULL, ...)
A length-one numeric vector.
Numeric vector.
Optional vector of non-negative case weights.
Further arguments passed to mean() or stats::weighted.mean().
mean()
weighted_mean(1:10) weighted_mean(1:10, w = NULL) weighted_mean(1:10, w = 1:10)
Run the code above in your browser using DataLab