Skip to contents

The geometric mean is the nth root of n products or e to the mean log of x.

Usage

geometricMean(x, ...)

# S4 method for sparseMatrix
geometricMean(x, MARGIN = 2L)

Arguments

x

Object.

MARGIN

integer(1-2). Dimension where the function will be applied. For a two-dimensional matrix: 1 indicates rows; 2 indicates columns; c(1, 2) indicates rows and columns.

...

Additional arguments.

Value

numeric.

Details

Useful for describing non-normal (i.e. geometric) distributions.

Note

Updated 2022-10-24.

Examples

data(sparseMatrix, package = "AcidTest")

## Matrix ====
x <- sparseMatrix
geometricMean(x)
#> sample01 sample02 sample03 sample04 sample05 sample06 sample07 sample08 
#> 1.000000 1.275373 1.000000 1.000000 1.000000 1.463111 1.516683 1.559583 
#> sample09 sample10 
#> 2.219076 1.626577