Learn R Programming

tricolore (version 1.2.2)

GeometricMean: Geometric Mean

Description

Calculate the geometric mean for a numeric vector.

Usage

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

Arguments

x

Numeric vector.

na.rm

Should NAs be removed? (default=TRUE)

zero.rm

Should zeros be removed? (default=TRUE)

Value

The geometric mean as numeric scalar.

Examples

Run this code
# NOT RUN {
tricolore:::GeometricMean(0:100)
tricolore:::GeometricMean(0:100, zero.rm = FALSE)

# }

Run the code above in your browser using DataLab