colVars_spm: Variance computation for sparse matrices

Description Usage Arguments Details Value See Also Examples

View source: R/variance.R

Description

Compute variance for each column / each row of a dgCMatrix (from Matrix package).

Usage

1
2
3

Arguments

spm

A sparse matrix of class dgCMatrix from the Matrix package.

Details

The only supported format currently is dgCMatrix. While the Matrix package has other formats, this one is used for scRNAseq raw count data. Function code written by Simon Anders.

Value

Vector with variances.

See Also

vignette("Intro2Matrix", package="Matrix") CsparseMatrix-class

Examples

1
2
3
library(Matrix)
 mat <- as(matrix(rpois(900,1), ncol=3), "dgCMatrix")
 colVars_spm(mat)

scUtils documentation built on July 2, 2020, 4:05 a.m.