Return location of minimum, maximum and mode values' index
Source:R/which_min-max-mode.R
which_min.Rd
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.
Usage
which_min(x, first_only = FALSE)
which_max(x, first_only = FALSE)
which_mode(x, first_only = FALSE)
Arguments
- x
A numeric or vector
- first_only
Logical value indicating whether only the first value should be returned (i.e. if
TRUE
the function behaves likewhich.min()
andwhich.max()
). Default is FALSE.