Learn R Programming

ramify (version 0.4.0)

argmax: Row/Column Max/Min Indices

Description

Returns the indices of the maximum or minimum values along an axis.

Usage

argmax(x, rows = TRUE)

argmin(x, rows = TRUE)

Value

A vector of indices.

Arguments

x

A matrix.

rows

If TRUE (the default) the indices of each row max/min is returned.

Examples

Run this code
m <- mat("94, 20, 44; 40, 92, 51; 27, 69, 74")
argmax(m)
argmin(m)

Run the code above in your browser using DataLab