harm | R Documentation |
This function calculates harmonic mean of a vector and can be used analogous to the base functions mean() or median()
harm(x, w = 1, na.rm = FALSE)
x |
(numeric vector) |
w |
(numeric vector) optional vector of weights corresponding to x. Default is 1 for all. |
na.rm |
(logical) If TRUE, then NA values are omitted and the mean calculated with the remaining values. If FALSE (default) then returns NA if x contains NA values. |
(numeric) harmonic mean of x
{
harm(c(1:10))
harm(c(1:10),c(10:1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.