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
Post a Comment