I'm trying to obtain the three largest number in a vector, with R. With function max() I can get the first one, is there any function that I can choose the number of values that I want?
For example: vector <- c(100,215,200,180,300,500,130) max(vector)
This will returne 500, I want something that returns: 500, 300, 215.
I've tried
pmax(vector,3)