R/statistics.R
gm.Rd
Calculate geometric mean
gm(x, na.rm = FALSE, neg.rm = FALSE)
Numeric vector.
Flag for removing NA values (defaults to FALSE).
NA
FALSE
Flag for removing negative or zero values (defaults to FALSE).
The geometric mean. NA is returned if there are any non-positive elements in x.
x
Justin Wilkins, justin.wilkins@occams.com
gm(c(0.5, 7, 8, 5)) #> [1] 3.439791