Learn R Programming

spatialEco (version 2.0-2)

nth.values: Nth values

Description

Returns the Nth highest or lowest values in a vector

Usage

nth.values(x, N = 2, smallest = FALSE)

Value

Numeric vector of Nth values

Arguments

x

Numeric vector

N

Number of (Nth) values returned

smallest

(FALSE/TRUE) Return the highest, else smallest values

Author

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Details

This function returns n lowest or highest elements in a vector

Examples

Run this code
nth.values(1:20, N=3, smallest = TRUE)                 
nth.values(1:20, N=3)

Run the code above in your browser using DataLab