j1wan / topk

An R package to get min/max/argmin/argmax k elements from a vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MinK, MaxK, WhichMinK, WhichMaxK for R

An R package to get k minimum or maximum values from a numeric vector, or to get the indices of them.

Installation

devtools::install_github('j1wan/topk')

Example

x <- sample(1:100)
MinK(x, 10)
MaxK(x, 20)
WhichMinK(x, 10)
WhichMaxK(x, 20)

About

An R package to get min/max/argmin/argmax k elements from a vector


Languages

Language:R 100.0%