Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
which.max位置、つまり、数値ベクトルの (最初の) 最小値または最大値のインデックスを決定します。ベクトルに複数の最大値がある場合、それらすべてを取得するにはどうすればよいですか?
which.max
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).
which( myVector == max(myVector) )