[81de4e]: / which.is.max.R

Download this file

7 lines (7 with data), 122 Bytes

1
2
3
4
5
6
7
which.is.max <- function (x)
{
y <- seq(length(x))[x == max(x)]
if (length(y) > 1)
y <- sample(y, 1)
y
}