geometric.mean {swfscMisc}R Documentation

Geometric Mean

Description

Calculates the geometric mean of a vector.

Usage

geometric.mean(x, w = NULL, na.rm = FALSE)

Arguments

x

a numeric vector.

w

an optional numerical vector of weights the same length as x.

na.rm

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

Author(s)

Eric Archer eric.archer@noaa.gov

Examples

x <- rlnorm(100)
mean(x)
median(x)
geometric.mean(x)


[Package swfscMisc version 1.6.5 Index]