I have a vector and I'm able to return highest and lowest value, but how to return 5 topmost values? Is there a simple one-line solution for this?
> a <- c(1:100) > tail(sort(a),5) [1] 96 97 98 99 100
2.1m questions
2.1m answers
60 comments
57.0k users