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

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -