Description Usage Arguments Value Examples
Calculates the geometric mean of a set of positive numbers. The function calculates the product of every number in the vector and takes the nth root, where n is the number of elements in the vector.
1 | geometricmean(input, na.rm = FALSE)
|
input |
a vector of numbers |
na.rm |
true or false for whether to remove NA's before performing the calculation |
A number
1 2 3 4 5 6 7 8 | a <- c(3,9,5,8)
geometricmean(a)
b <- c(NA,3,NA,7,9,2)
geometricmean(b)
d <- c(NA,3,NA,7,9,2)
geometricmean(d,na.rm=T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.