geomean: Compute the geometric mean

View source: R/geomean.R

geomeanR Documentation

Compute the geometric mean

Description

geomean computes the anti-log of the mean of log10-transformed data.

Usage

geomean(x)

Arguments

x

A numeric value, vector or list.

Details

This function first log10-transforms the original data x. It then back-transforms the mean of the results from the log10 scale.

If any null values are present in x they are first replaced with NA.

Value

Returns the geometric mean of x.

Author(s)

Felipe Figueiredo

Examples

d <- c(10,100,1000)
geomean(d)
geomean(c(d,0)) # na.rm is TRUE by default for sd()


philsf/philsfmisc documentation built on April 11, 2022, 9:04 p.m.