eeptools (version 1.2.5)

nth_max: Find the nth maximum value

Description

Find the nth maximum value

Usage

nth_max(x, n = 1)

Value

the value of the nth most maximum value in a vector

Arguments

x

a vector of numeric values

n

which max to return

Examples

Run this code
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