R/wtdMean.R

Defines functions wtdMean

Documented in wtdMean

wtdMean <- function(x) {
    wts <- getWts(x)
    wm  <- Reduce("+",lapply(x,function(u){u*attr(u,"weight")}))/sum(wts)
    attr(wm,"weight") <- NULL
    wm
}

Try the kanova package in your browser

Any scripts or data that you put into this service are public.

kanova documentation built on Aug. 8, 2025, 7:50 p.m.