Learn R Programming

compositions (version 0.9-11)

geometricmean: The geometric mean

Description

Computes the geometric mean.

Usage

geometricmean(x,...)
          geometricmean.row(x,...)
          geometricmean.col(x,...)

Arguments

x
a numeric vector or matrix of data
...
further arguments to compute the mean

Value

  • The geometric means of x as a whole (geometricmean), its rows (geometricmean.row) or its columns (geometricmean.col).

Details

The geometric mean is defined as: $$geometricmean(x) := \left( \prod_{i=1}^n x_i\right)^{1/n}$$ The geometric mean is actually computed by exp(mean(log(c(unclass(x))),...)).

See Also

mean.rplus

Examples

Run this code
geometricmean(1:10)

Run the code above in your browser using DataLab