harmean: Harmonic mean

View source: R/harmean.R

harmeanR Documentation

Harmonic mean

Description

Returns the harmonic mean of a vector of numbers.

Usage

harmean(x, na.rm = FALSE)

Arguments

x

Vector of numbers, required.

na.rm

Logical value, optional, FALSE by default. If FALSE, result is NA if any of the values in x is NA. If TRUE, remove the NA values first.

Details

The harmonic mean is one type of average. It is the reciprocal of the arithmetic mean of the reciprocals. See http://en.wikipedia.org/wiki/Harmonic_mean for many applications of the harmonic mean.

Value

Returns a single number

See Also

geomean() mean() rms()

Examples

harmean(c(1,2,4))

ejanalysis/analyze.stuff documentation built on Dec. 11, 2024, 2:16 p.m.