I'm dealing with a matrix like : "x" "y" "z" [1,] 2 4 1 [2,] 6 1 2 ... [n,] 7 3 1 For each row I would like to know the header of the column which corresponds to the minimum value. In the case of my matrix, I would like to obtain the following vector : z y ... z Any idea ?