R/n_functions.R
n_functions.Rd
Returns the n maximum or n minimum values of a vector.
n_max(vec, n = 5)
n_min(vec, n = 5)
A vector from which to select the max or min values.
The number of values to return.
The n max or min values of your vector.
x <- rnorm(100)
n_max(x)
#> [1] 1.774904 1.585633 1.548295 1.530684 1.432115
n_min(x)
#> [1] -2.912304 -2.701623 -2.335116 -2.142588 -1.476763