Find Maximum Position in Vector or Matrix

Usage

which.is.max(x)
max.col(A)

Arguments

x a vector
A a matrix

Description

Find the maximum position in a vector or for each row of a matrix, breaking ties at random.

Details

Ties are broken at random.

Value

index of a maximal value (for each row in the case of max.col).

Examples


pred <- predict(nnet, test)
table(true, apply(pred,1,which.is.max))


[Package Contents]