nnet (version 7.3-17)

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)

Value

index of a maximal value.

Arguments

x

a vector

Details

Ties are broken at random.

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

Run this code
if (FALSE) ## this is incomplete
pred <- predict(nnet, test)
table(true, apply(pred, 1, which.is.max))

Run the code above in your browser using DataLab