Returns the indices of the maximum or minimum values along an axis.
Arguments
- x
A matrix.
- rows
If
TRUE
(the default) the indices of each row max/min is returned.
Examples
m <- mat("94, 20, 44; 40, 92, 51; 27, 69, 74")
argmax(m)
#> [1] 1 2 3
argmin(m)
#> [1] 2 1 1