harmonic_mean: Harmonic mean

Description Usage Arguments Value Examples

Description

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

Usage

1
harmonic_mean(x, na.rm = TRUE)

Arguments

x

numeric vector

na.rm

logical remove NAs prior or calculation

Value

harmonic mean of vector

Examples

1
2
3
data(nancycats)
pop.sizes <- table(pop(nancycats))
harmonic_mean(pop.sizes)

mmod documentation built on May 1, 2019, 10:55 p.m.