In flow cytometry the geometric mean is a common metric of central tendency. It is less susceptible to outliers than the arithmetic mean, but more susceptible as compared to the median. If you have untransformed values of fluorescence intensities (original output of the machines) this function may not work as you may have negative values in your vector x. Hence, the median has to be used or the data needs transformation (e.g. logicle transformation).

geo_mean(x, rm.na = F)

Arguments

x

numeric vector

rm.na

logical if to remove na or not

Value

a numeric representing the geometric mean of values in x

Examples

geo_mean(c(1,2,3,10,100))
#> [1] 5.696791