Index of the maximum per row

which.pmax(...)

Arguments

...

Numeric or character vectors of the same length

Value

Vector of rankings

Details

Determine the index of the maximum of the input vectors per row. Extension of which.max

See also

See also which.max and which.pmin

Examples

which.pmax(1:10, 10:1)
#> [1] 2 2 2 2 2 1 1 1 1 1
which.pmax(2, 10:1)
#> [1] 2 2 2 2 2 2 2 2 1 1
which.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