gmean {comparator} | R Documentation |
Geometric Mean
Description
Geometric Mean
Usage
gmean(x, ...)
## Default S3 method:
gmean(x, na.rm = FALSE, ...)
Arguments
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 |
Value
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.
See Also
mean
for the arithmetic mean and hmean
for the harmonic
mean.
Examples
x <- c(1:10, 50)
xm <- gmean(x)
[Package comparator version 0.1.2 Index]