topk: Where are the minimum or maximum k elements?

Description Usage Arguments Examples

Description

Determines the locations, i.e. indices of the minium or maximum k elements of a numeric vector.

Usage

1
2
WhichMinK(x, k)
WhichMaxK(x, k)

Arguments

x

numeric vector whose min or max is searched for.

Examples

1
2
3
x <- sample(1:100)
WhichMinK(x, 10)
WhichMaxK(x, 10)

j1wan/topk documentation built on May 18, 2019, 7:15 a.m.