Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nth.values

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

Value

Numeric vector of Nth values

Note

This function returns n lowest or highest elements in a vector

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

Spatial Analysis and Modelling Utilities

v1.3-6
GPL-3
Authors
Jeffrey S. Evans [aut, cre], Melanie A. Murphy [ctb], Karthik Ram [ctb]
Initial release
2021-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.