Learn R Programming

swfscMisc (version 1.2)

harmonic.mean: Harmonic Mean

Description

Calculate the harmonic mean of a set of numbers.

Usage

harmonic.mean(x, na.rm = FALSE)

Arguments

x

a numeric vector.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Examples

Run this code
# NOT RUN {
x <- rlnorm(100)
mean(x)
median(x)
harmonic.mean(x)

# }

Run the code above in your browser using DataLab