which.max Determines the location, i.e., index of the (first) minimum or
maximum of a numeric vector. If the vector has multiple max, how can I retrieve all of them?
which.max Determines the location, i.e., index of the (first) minimum or maximum of a
Share
You could do
which( myVector == max(myVector) ), which is basically whatwhich.maxis (except thatwhich.maxstops at the first occurence and is implemented a bit more efficiently).