Learn R Programming

multilateral (version 1.0.0)

gm_mean: Geometric mean

Description

Calculate the geometric mean of a vector of numbers

Usage

gm_mean(x, na.rm = TRUE)

Arguments

x

an R numerical object

na.rm

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

Value

If all values in x are numeric class, a single numeric class value is returned.

Examples

Run this code
# NOT RUN {
x <- c(0:10, 50)
gm_mean(x)

# }

Run the code above in your browser using DataLab