[r] Finding row index containing maximum value using R