argmax: Row/Column Max/Min Indices

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
argmax(x, rows = TRUE)

argmin(x, rows = TRUE)

Arguments

x

A matrix.

rows

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

Value

A vector of indices.

Examples

1
2
3
m <- mat("94, 20, 44; 40, 92, 51; 27, 69, 74")
argmax(m)
argmin(m)

Example output

Attaching package: 'ramify'

The following object is masked from 'package:graphics':

    clip

[1] 1 2 3
[1] 2 1 1

ramify documentation built on May 2, 2019, 5:58 a.m.