weighted_gmean: Weighted geometric mean

View source: R/weighting.R

weighted_gmeanR Documentation

Weighted geometric mean

Description

Calculate weighted geometric mean

Usage

weighted_gmean(x, w, na.rm = FALSE)

Arguments

x

a numeric vector

w

a numeric vector for weights

na.rm

A logical. Should missing x values be removed?

Examples

x <- c(1,2,3, NA)
w <- c(0.25,0.5,0.25, NA)
weighted_gmean(x, w, na.rm = TRUE)

pttry/ficomp documentation built on June 11, 2024, 9:53 p.m.