#' Title
#'
#' @param x
#' @param neg.rm
#' @param default
#'
#' @return
#' @export
#'
#' @examples
geomean <- function(x, neg.rm = TRUE, default = 1) {
x <- x[is.finite(x)]
if (neg.rm) x <- x[x > 0]
if (length(x) == 0L) return(default)
else return(prod(x) ^ (1 / length(x)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.