Learn R Programming

mkin (version 0.9-31)

geometric_mean: Calculate the geometric mean

Description

Function calculating the geometric mean of numeric vectors

Usage

geometric_mean(x, na.rm = FALSE)

Arguments

x
A numeric vector
na.rm
Should NA values be ignored

Value

  • The geometric mean.

Examples

Run this code
geometric_mean(c(1,3, 9))
  geometric_mean(c(1,3, NA))
  geometric_mean(c(1,3, NA), na.rm = TRUE)

Run the code above in your browser using DataLab