weighted_gmean | R Documentation |
Calculate weighted geometric mean
weighted_gmean(x, w, na.rm = FALSE)
x |
a numeric vector |
w |
a numeric vector for weights |
na.rm |
A logical. Should missing x values be removed? |
x <- c(1,2,3, NA)
w <- c(0.25,0.5,0.25, NA)
weighted_gmean(x, w, na.rm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.