Skip to content
Prev 30101 / 398503 Next

Index of item in matrix

Look at ?which.

Specifically the form: which(x, arr.ind = TRUE)
[,1] [,2] [,3] [,4]
[1,]    1    4    7   10
[2,]    2    5    8   11
[3,]    3    6    9   12
row col
[1,]   3   3
[1] 9


HTH,

Marc Schwartz