gm_mean: Geometric mean

Description Usage Arguments Value Examples

Description

Calculates the geometric mean of a vector

Usage

1
gm_mean(x, na.rm = TRUE, zero.propagate = FALSE)

Arguments

x

input vector

na.rm

logical. If true, NA are removed before calculation

zero.propagate

logical. If TRUE, checks the vector for zeros and skips calculation

Value

returns the geometric mean

Examples

1
2
3
4
x = runif(10, 1, 5)
gm_mean(x)
gm_mean(c(1, 2, NA, 0), na.rm = FALSE)
gm_mean(c(1, 2, NA, 0), na.rm = FALSE, zero.propagate = TRUE)

diogro/ratones documentation built on May 24, 2019, 4:01 a.m.