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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -