rowArgmax: Column index of the maximum value for each row in a matrix

rowArgmaxR Documentation

Column index of the maximum value for each row in a matrix

Description

Column index of the maximum value for each row in a matrix

Usage

rowArgmax(X)

Arguments

X

A matrix of floats.

Value

a vector of the index of column for each row. Note, when multiple columns have the same value, only the earliest column will be returned.

Examples

matA <- matrix(sample(seq(12)), nrow = 3)
rowArgmax(matA)

davismcc/cardelino documentation built on Nov. 19, 2022, 2:44 a.m.