nth.values: Nth values

View source: R/nth.values.R

nth.valuesR Documentation

Nth values

Description

Returns the Nth highest or lowest values in a vector

Usage

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

Arguments

x

Numeric vector

N

Number of (Nth) values returned

smallest

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

Details

This function returns n lowest or highest elements in a vector

Value

Numeric vector of Nth values

Author(s)

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Examples

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


spatialEco documentation built on Nov. 18, 2023, 1:13 a.m.