R/matArrays.R

matArrays <-
function (lis, na.rm = FALSE) {
    M <- length(lis)
    dims <- dim(lis[[1]])
    mat <- unlist(lis)
    dim(mat) <- c(length(mat)/M, M)
    array(rowMeans(mat), dims)
}

Try the ltm package in your browser

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

ltm documentation built on March 18, 2022, 6:36 p.m.