rt_geometric_mean: Calculates the geometric mean of a vector of numbers

View source: R/stats.R

rt_geometric_meanR Documentation

Calculates the geometric mean of a vector of numbers

Description

Calculates the geometric mean of a vector of numbers

Usage

rt_geometric_mean(values, na.rm = TRUE, add_subtract = 1e-04)

Arguments

values

vector of numeric values

na.rm

if TRUE then remove NA values, if FALSE then return NA if any NA values exist

add_subtract

since the geometric mean takes the log of the values, a value/log of 0 will cause problems; 'add_subtract' adds the number to the values and then subtracts the value after taking the mean (but before taking the exponent)


shane-kercheval/rtools documentation built on July 7, 2022, 8:31 a.m.