which.min2 | R Documentation |
which.min
and which.max
for n indicesReturns the indices of the first n
min and max positions.
which.min2(x, n = 1L)
which.max2(x, n = 1L)
x |
numeric (logical, integer, or double) vector or an |
n |
the number of first min or max to return |
which.min
; which.max
x <- c(3, 1, 2, -2, 5)
stopifnot(identical(which.min(x), which.min2(x)))
stopifnot(identical(which.max(x), which.max2(x)))
which.min2(NA, 3)
which.min2(x, 3)
which.max2(x, 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.