How to compute weighted mean in R?

Use weighted.mean:

> weighted.mean(z$size, z$count)
[1] 4

Leave a Comment