whichNonZero | R Documentation |
Finds the non-zero entries of a matrix in the most efficient manner for each matrix representation. Not sure there's much more to say here.
whichNonZero(x, ...)
## S4 method for signature 'ANY'
whichNonZero(x, ...)
## S4 method for signature 'TsparseMatrix'
whichNonZero(x, ...)
## S4 method for signature 'CsparseMatrix'
whichNonZero(x, ...)
## S4 method for signature 'SparseArraySeed'
whichNonZero(x, ...)
## S4 method for signature 'DelayedMatrix'
whichNonZero(x, BPPARAM = NULL, ...)
x |
A numeric matrix-like object, usually sparse in content if not in representation. |
... |
For the generic, additional arguments to pass to the specific methods. For the methods, additional arguments that are currently ignored. |
BPPARAM |
A BiocParallelParam object from the BiocParallel package controlling how parallelization should be performed.
Only used when |
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.
Aaron Lun
which
, obviously.
x <- Matrix::rsparsematrix(1e6, 1e6, 0.000001)
out <- whichNonZero(x)
str(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.