rowVars_fast: Computes Row Variances Efficiently

View source: R/RcppExports.R

rowVars_fastR Documentation

Computes Row Variances Efficiently

Description

Computes Row Variances Efficiently

Usage

rowVars_fast(x, n_cores)

Arguments

x

A numeric dense matrix for which to compute row variances.

n_cores

The number of cores to utilize for parallel processing.

Value

A numeric vector containing the variance for each row of the input matrix.

Examples


library(Matrix)
rand_vals <- sample(0:10,1e4,replace=TRUE, p=c(0.99,rep(0.001,10)))
x <- as.matrix(Matrix(rand_vals,ncol=5))
cores <- 2
vars_vector <- rowVars_fast(x, cores)


khazum/ccImpute documentation built on July 26, 2024, 1:13 a.m.