Function calculating the geometric mean of numeric vectors
geometric_mean(x, na.rm = FALSE)
x | A numeric vector |
---|---|
na.rm | Should NA values be ignored |
The geometric mean.
geometric_mean(c(1,3, 9))#> [1] 3geometric_mean(c(1,3, NA))#> [1] NAgeometric_mean(c(1,3, NA), na.rm = TRUE)#> [1] 1.732051