SyntaxFix
Write A Post
Hire A Developer
Questions
See ?order. You just need the last index (or first, in decreasing order), so this should do the trick:
?order
order(matrix[,2],decreasing=T)[1]