harmonic_mean {mmod} | R Documentation |
Calculate the harmonic mean of a numeric vector (will return NA if there are any negative numbers in the vector)
harmonic_mean(x, na.rm = TRUE)
x |
numeric vector |
na.rm |
logical remove NAs prior or calculation |
harmonic mean of vector
data(nancycats)
pop.sizes <- table(pop(nancycats))
harmonic_mean(pop.sizes)