View source: R/generalized_mean.R
gmean | R Documentation |
Geometric Mean
gmean(x, ...) ## Default S3 method: gmean(x, na.rm = FALSE, ...)
x |
An R object. Currently there are methods for numeric/logical
vectors and date, date-time and time interval objects. Complex vectors
are allowed for |
... |
further arguments passed to or from other methods. |
na.rm |
a logical value indicating whether |
The geometric mean of the values in x
is computed, as a numeric
or complex vector of length one. If x
is not logical (coerced to
numeric), numeric (including integer) or complex, NA_real_
is returned,
with a warning.
mean
for the arithmetic mean and hmean
for the harmonic
mean.
x <- c(1:10, 50) xm <- gmean(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.