powered by
Calculate the geometric mean of a numeric vector, possibly excluding zeroes and/or adding an offset to compensate for zero values.
calcGM(x, offset = 0, exzero = TRUE)
vector of numbers
value to add to all components, including zeroes
if TRUE, exclude zeroes (but still add the offset)
TRUE
Geometric mean of the modified vector x + offset
x + offset
# NOT RUN { local(envir=.PBSmodEnv,expr={ calcGM(c(0,1,100)) calcGM(c(0,1,100),offset=0.01,exzero=FALSE) }) # }
Run the code above in your browser using DataLab