nth_highest: N-th Highest Value Function

Description Usage Arguments Examples

View source: R/Utility_functions.R

Description

This function allows you to calculate the N-th highest number of a vector. In other words, it is the N-th max; it calculates the maximum after removing (n-1) higher numbers (maxes). Note that k=1 yields the traditional global maximum.

Usage

1
nth_highest(x, k = 1)

Arguments

x

Data vector.

k

The N-th highest value or N-th max. For example, k=2 yields the second highest value. Note that k=1 gives the highest value aka the global max. Defaults to 1.

Examples

1
2
data<-c(rnorm(15,0,1),rnorm(21,5,1))
nth_highest(data,2)

modes documentation built on May 20, 2017, 2:15 a.m.

Search within the modes package
Search all R packages, documentation and source code