View source: R/harmonic.mean.R
harmonic.mean | R Documentation |
Calculate the harmonic mean of a set of numbers.
harmonic.mean(x, w = NULL, na.rm = FALSE)
x |
a numeric vector. |
w |
an optional numerical vector of weights the same length as |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
If zeroes are present in x
, function will return approximation
with a warning. In this case, weights will not be used.
Eric Archer eric.archer@noaa.gov
x <- rlnorm(100)
mean(x)
median(x)
harmonic.mean(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.