Description Usage Arguments Value Author(s) See Also Examples
Finds the non-zero entries of a matrix in the most efficient manner. Not sure there's much more to say here.
1 2 3 4 5 6 7 8 9 10 | whichNonZero(x, ...)
## S4 method for signature 'dgTMatrix'
whichNonZero(x, ...)
## S4 method for signature 'dgCMatrix'
whichNonZero(x, ...)
## S4 method for signature 'ANY'
whichNonZero(x, BPPARAM = SerialParam(), ...)
|
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 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 numeric vector of the values of the non-zero entries.
Aaron Lun
which
, obviously.
1 2 3 | 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.