Calculates the geometric mean by adding 1 before logging and subtracting 1 before exponentiating so that provides results even with zero counts. Not used by any wqbc functions but provided as may be helpful if averaging bacterial counts.

geomean1(x, na.rm = FALSE)

Arguments

x

A numeric vector of non-negative numbers.

na.rm

A flag indicating whether to remove missing values.

Examples

mean(0:9)
#> [1] 4.5
geomean1(0:9)
#> [1] 3.528729