Like the title says. I am having trouble. for example I have a 2 column (V1,V2) dataframe with lots of rows, around 300,000. I know that
max(df$V2)
You have to write
df[which.max(df$V2), ]
If more than one row contains the max:
i <- max(df$V2) df[which(df$V2 == i), ]