R/weighted_colMeans.R

Defines functions weighted_colMeans

## File Name: weighted_colMeans.R
## File Version: 0.09

weighted_colMeans <- function( mat, wgt=NULL)
{
    wgt <- weighted_stats_extend_wgt( wgt=wgt, mat=mat )
    mat1 <- colSums( mat * wgt, na.rm=TRUE)
    mat2 <- colSums( wgt, na.rm=TRUE)
    mat1 <- mat1 / mat2
    return(mat1)
}

Try the sirt package in your browser

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

sirt documentation built on May 29, 2024, 8:43 a.m.