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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

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