R/colmeansvars.R

Defines functions colmeansvars

Documented in colmeansvars

#[export]
colmeansvars <- function(x, std = FALSE, parallel = FALSE) {
    m <- Rfast::colmeans(x, parallel = parallel)
    s <- Rfast::colVars(x, std = std, parallel = parallel)
    z <- rbind(m, s)
    if (std) {
      rownames(z) <- c("means", "stds")
    } else rownames(z) <- c("means", "variances")
    z
}

Try the Rfast2 package in your browser

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

Rfast2 documentation built on Aug. 8, 2023, 1:11 a.m.