title: How to interpret array indices in which() output?
body: <p>I'm very new to R, so this is very much a beginner's question.</p>
  <p>I'm trying to read/interpret the returned matrix from a <code>which(x , arr.ind = TRUE)</code> command.</p>
  <p>The data I'm using is:</p>
  <p><code>qux &lt;- array(data = c(10,5,1,4,7,4,3,3,1,3,4,3,1,7,8,3,7,3), dim = c(3, 2, 3))</code></p>
  <p>I run <code>which()</code> while filtering for values lower than 3 and tell the <code>which()</code> function to return array indices, using <code>arr.ind = TRUE</code>.</p>
  <pre><code>&gt; which(qux&lt;3, arr.ind = TRUE)
  
       dim1 dim2 dim3
  [1,]    3    1    1
  [2,]    3    1    2
  [3,]    1    1    3
  </code></pre>
  <p>I would assume the numbers in the left most column indicate the rows (of which there are 3 in the array), the other three columns to the right indicate the dimensions (of which there are also 3), and the numbers that make up the matrix are the column numbers.</p>
  <p>However, this can't be true since there are only two columns in all the dimensions of the array, whereas there's three 3's in the matrix.</p>
  <p>Please help me understand this elementary part of R.</p>
  <p>Kind regards.</p>