Revision 2ad963b97009de7f1bf46c5da8604388c2c67d05 authored by Matthias Templ on 27 February 2013, 09:44:32 UTC, committed by cran-robot on 27 February 2013, 09:44:32 UTC
1 parent 823295f
Raw File
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