Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

which.is.max

Find Maximum Position in Vector


Description

Find the maximum position in a vector, breaking ties at random.

Usage

which.is.max(x)

Arguments

x

a vector

Details

Ties are broken at random.

Value

index of a maximal value.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

max.col, which.max which takes the first of ties.

Examples

## Not run: ## this is incomplete
pred <- predict(nnet, test)
table(true, apply(pred, 1, which.is.max))

## End(Not run)

nnet

Feed-Forward Neural Networks and Multinomial Log-Linear Models

v7.3-16
GPL-2 | GPL-3
Authors
Brian Ripley [aut, cre, cph], William Venables [cph]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.