wmean {RVAideMemoire} | R Documentation |
Weighted arithmetic mean
Description
Computes the weighted arithmetic mean of a vector.
Usage
wmean(x, w = rep(1, length(x)), na.rm = TRUE)
Arguments
x |
numeric vector. |
w |
numeric vector of weights. |
na.rm |
a logical value indicating whether |
Author(s)
Maxime HERVE <maxime.herve@univ-rennes1.fr>
Examples
mean(1:10)
wmean(1:10,w=10:1)
[Package RVAideMemoire version 0.9-83-7 Index]