Harmonic mean

Usage

harmonic_mean(x)

Arguments

x
numeric vector

Value

harmonic mean of vector

Description

Calculate the harmonic mean of a numeric vector (will return NA if there are any negative numbers in the vector)

Examples

data(nancycats) pop.sizes <- table(pop(nancycats)) harmonic_mean(pop.sizes)
[1] 12.96096