topK {tensr} | R Documentation |
Top K elements of a vector.
Description
Identify top K elements of a vector.
Usage
topK(x, K = 1, ignoreties = TRUE)
Arguments
x |
The vector. |
K |
The number of indices to return. |
ignoreties |
If |
Details
This function returns the indices corresponding to the top elements of a vector.
Author(s)
Peter Hoff.
Examples
x <- c(3, 6, 2, 4, 1)
tensr:::topK(x, 3)
[Package tensr version 1.0.1 Index]