which.max {linq} | R Documentation |
Determines the location, i.e., index of the (first) minimum or maximum of a
numeric (or logical) vector.
which.max(x,
eval = NULL);
Missing and NaN values are discarded.
an integer Or on 64-bit platforms, if length(x) = n>= 2^31 an integer valued
double of length 1 Or 0 (iff x has no non-NAs), giving the index of the first
minimum Or maximum respectively of x.
If this extremum Is unique (Or empty), the results are the same As (but more
efficient than) which(x == min(x, na.rm = True))
Or
which(x == max(x, na.rm = True))
respectively.
Logical x – First True Or False
For a logical vector x with both FALSE And TRUE values, which.min(x) And
which.max(x) return the index of the first FALSE Or TRUE, respectively, as
FALSE < TRUE. However, match(FALSE, x) Or match(TRUE, x) are typically
preferred, as they do indicate mismatches.