View source: R/which_min-max-mode.R
which_min | R Documentation |
These function return the position (index) of all the minimum, maximum, and mode values of the vector x
. which_min()
and which_max()
only support numeric and logical vectors.
These functions are identical to which.min()
and which.max()
, except that ALL minima/maxima are returned instead of only the first one.
which_min(x, first_only = FALSE)
which_max(x, first_only = FALSE)
which_mode(x, first_only = FALSE)
x |
A numeric or vector |
first_only |
Logical value indicating whether only the first value should be returned (i.e. if |
Returns the position of the minimum, maximum and mode values of a vector x
Mode, which.min, which.max
which_mode(c("a","a",2,3))
which_min(c(1,1,2,3,NA,2))
which_max(c(NA,NA,NA,1,1,2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.