Learn R Programming

tricolore (version 1.2.6)

GeometricMean: Geometric Mean

Description

Calculate the geometric mean for a numeric vector.

Usage

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

Value

The geometric mean as numeric scalar.

Arguments

x

Numeric vector.

na.rm

Should NAs be removed? (default=TRUE)

zero.rm

Should zeros be removed? (default=TRUE)

Examples

Run this code
# NOTE: only intended for internal use and not part of the API
tricolore:::GeometricMean(0:100)
tricolore:::GeometricMean(0:100, zero.rm = FALSE)

Run the code above in your browser using DataLab