powered by
nth_max(x, n = 1)
x <- c(1:20, 20:1) nth_max(x, n = 1) #20 nth_max(x, n = 2) #19
Run the code above in your browser using DataLab