harmonic_mean {mmod} | R Documentation |
Harmonic mean
Description
Calculate the harmonic mean of a numeric vector (will return NA if there are any negative numbers in the vector)
Usage
harmonic_mean(x, na.rm = TRUE)
Arguments
x |
numeric vector |
na.rm |
logical remove NAs prior or calculation |
Value
harmonic mean of vector
Examples
data(nancycats)
pop.sizes <- table(pop(nancycats))
harmonic_mean(pop.sizes)
[Package mmod version 1.3.3 Index]