https://github.com/cran/robCompositions
Raw File
Tip revision: 54cbcf1d6d3ecbca1153e8f00a804e837237f09d authored by Matthias Templ on 07 February 2014, 00:00:00 UTC
version 1.7.0
Tip revision: 54cbcf1
gm.R
gm <- function (x) {
	if(!is.numeric(x)) stop("x has to be a vector of class numeric")
	if (any(na.omit(x == 0)))
		0
	else exp(mean(log(unclass(x)[is.finite(x) & x > 0])))
}
back to top