R/gm_mean.R

Defines functions gm_mean

Documented in gm_mean

#' Geometric mean
#'
#' Calculates the geometric mean of a vector (x)
#' @param x Numeric vector
#' @example 
#' x <- 1:100
#' gm_mean(x)
#' @return geometric mean (scalar) of input
#' @export
gm_mean <- function(x){
  exp(mean(log(x)))
}
mortenarendt/MBtransfeR documentation built on Aug. 23, 2020, 10:03 p.m.