Index of the maximum per row
which.pmax(...)
... | Numeric or character vectors of the same length |
---|
Vector of rankings
Determine the index of the maximum of the input vectors per row. Extension of which.max
See also which.max
and which.pmin
which.pmax(1:10, 10:1)#> [1] 2 2 2 2 2 1 1 1 1 1which.pmax(2, 10:1)#> [1] 2 2 2 2 2 2 2 2 1 1which.pmax(mtcars)#> [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 3 4 4 3