Suppose I have a matrix like the example below called m1:
m1<-matrix(6:1,nrow=3,ncol=2)
[,1] [,2]
[1,] 6 3
[2,] 5 2
[3,] 4 1
How do I get the index row for the minimum value of each column?
I know which.min() will return the column index value for each row.
The output should be: 3 and 3 because the minimum for column [,1] is 4 corresponding to row [3,] and the minimum for column [,2] is 1 corresponding row [3,].