Given a matrix:
[,1] [,2]
[1,] 0 0.0
[2,] -1 0.8
What is the quickest way in R to iterate over the matrix and return the position of all non-zero entries as an index?
Given a matrix:
[,1] [,2]
[1,] 0 0.0
[2,] -1 0.8
What is the quickest way in R to iterate over the matrix and return the position of all non-zero entries as an index?