title: R: Find index of Matrix with smallest value
body: <p>Given matrix</p>
  
  <pre><code>x &lt;- matrix(c(1,2,3,4), nrow=2, ncol=2)
  colnames(x) &lt;- c('a','b')
  rownames(x) &lt;- c('c','d')
  </code></pre>
  
  <p>How do I find the column index/name and row index/name of the minimum value? </p>
  
  <p>I've tried which.min, but I need to get the row/column index rather than the element. Any ideas?</p>