Skip to contents

Compute the geometric mean of a numeric vector, optionally removing NA values.

Usage

geo_mean(x, na.rm = T)

Arguments

x

A numeric vector.

na.rm

Logical (default TRUE). Whether to remove NA values.

Value

A numeric scalar representing the geometric mean.

Details

Defined as exp(mean(log(x))), assuming all x > 0. Useful for combining multiplicative factors or log-normal distributions.