Skip to content
Prev 30161 / 398503 Next

Index of item in matrix

Or more simply:

 > set.seed(1)
 > A <- array(rnorm(12), dim=c(3,4))
 > which(round(A) == 1, arr.ind = TRUE)
      row col
[1,]   2   2
[2,]   1   4

Though, the original post may need more clarification.

Sundar
Spencer Graves wrote: