Get all the maximum value indexes in a R vector -



Get all the maximum value indexes in a R vector -

lets have vector in r :

v <- (2, 3, 4, 5, 5, 5)

we can find max of vector using max function :

max(v)

how can find indexes max value present. there function which.max(v) returns first index. there easy way indexes having max values in r ?

its dummy question, curious know.

how which(v == max(v)) ?

r vector indexing max

Comments

Popular posts from this blog

php - Edges appear in image after resizing -

ios8 - iOS custom keyboard - preserve state between appearances -

Delphi change the assembly code of a running process -