Skip to contents

Function for the geometric mean.

Usage

gmean(x, zero.rm = TRUE, na.rm = TRUE)

Arguments

x

a numeric or complex vector.

zero.rm

a logical evaluating to TRUE or FALSE indicating whether 0 values should be stripped before the computation proceeds.

na.rm

a logical evaluating to TRUE or FALSE indicating whether NA values should be stripped before the computation proceeds.

Value

Geometric mean, exp(mean(log(x)). NA values are removed if na.rm is TRUE.

Details

Returns NaN if x includes negative values.