R - return position of element in matrix?

Viewed 53862

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?

2 Answers
Related