harmonic_mean: Find the harmonic mean of a vector, matrix, or columns of a...

Description Usage Arguments Value Author(s) Examples

View source: R/utility.R

Description

The harmonic mean is merely the reciprocal of the arithmetic mean of the reciprocals.

Usage

1
harmonic_mean(x, na.rm = TRUE, zero = TRUE)

Arguments

x

A vector, matrix, or data.frame

na.rm

Logical. If TRUE, remove NA values before processing

zero

Logical, If TRUE, if there are any zeroes, return 0, else, return the harmonic mean of the non-zero elements

Value

The harmonic mean of x

Author(s)

Adapted from psych::harmonic.mean() by William Revelle

Examples

1

configural documentation built on Jan. 19, 2021, 1:06 a.m.