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?
You could do which( myVector == max(myVector) )
, which is basically what which.max
is (except that which.max
stops at the first occurence and is implemented a bit more efficiently).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With