colZeros: Count number of zeros in columns and rows of large matrices

View source: R/proxy.R

colZerosR Documentation

Count number of zeros in columns and rows of large matrices

Description

Produces the same result as applying sum(x == 0) to each row or column.

Usage

colZeros(x)

rowZeros(x)

Arguments

x

matrix or Matrix object

Examples

mt <- Matrix::rsparsematrix(100, 100, 0.01)
colZeros(mt)
apply(mt, 2, function(x) sum(x == 0)) # the same

proxyC documentation built on Oct. 25, 2023, 9:06 a.m.