--- a +++ b/which.is.max.R @@ -0,0 +1,7 @@ +which.is.max <- function (x) +{ + y <- seq(length(x))[x == max(x)] + if (length(y) > 1) + y <- sample(y, 1) + y +} \ No newline at end of file