whichNonZero: Find non-zero entries of a matrix

View source: R/whichNonZero.R

whichNonZeroR Documentation

Find non-zero entries of a matrix

Description

This function is soft-deprecated; users are advised to use nzwhich and nzvals instead.

Usage

whichNonZero(x, ...)

Arguments

x

A numeric matrix-like object, usually sparse in content if not in representation.

...

Further arguments, ignored.

Value

A list containing i, an integer vector of the row indices of all non-zero entries; j, an integer vector of the column indices of all non-zero entries; and x, a (usually atomic) vector of the values of the non-zero entries.

Author(s)

Aaron Lun

See Also

which, obviously.

Examples

x <- Matrix::rsparsematrix(1e6, 1e6, 0.000001)
out <- whichNonZero(x)
str(out)


LTLA/beachmat documentation built on Dec. 21, 2024, 12:11 a.m.