geomean: Geometric mean

Description Usage Arguments Details Value References Examples

Description

Function for the geometric mean.

Usage

1
geomean(x, na.rm = TRUE)

Arguments

x

a numeric vector.

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

Details

The geometric mean is comuted as

x = e^{(∑ \log x) / n}

Value

numeric vector of length one with the geometric mean.

References

http://stackoverflow.com/questions/2602583/geometric-mean-is-there-a-built-in

Examples

1
2
3
x <- c(1, 10, 100)
mean(x)
geomean(x)

EDiLD/esmisc documentation built on May 6, 2019, 2:59 p.m.