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.
大きな順序付けられていない行列があり、その2番目に高い値のインデックスを取得したいと思いました。
x <- matrix(c(4:7, 2, 1), nrow = 2, ncol = 3) which.max(x)
これにより、最大値7のインデックスとして4が得られます。しかし、2番目、3番目、または4番目に高いインデックスを取得する方法を知っている人はいますか。