gm | R Documentation |
Calculate geometric mean
gm(x, na.rm = FALSE, neg.rm = FALSE)
x |
Numeric vector. |
na.rm |
Flag for removing |
neg.rm |
Flag for removing negative or zero values (defaults to |
The geometric mean. NA
is returned if there are any non-positive elements in x
.
Justin Wilkins, justin.wilkins@occams.com
gm(c(0.5, 7, 8, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.