Given the following matrix lets assume I want to find the maximum value in column two:
mat <- matrix(c(1:3,7:9,4:6), byrow = T, nc = 3) mat [,1] [,2]
See ?which.max
?which.max
> which.max( matrix[,2] ) [1] 2