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.min(xdata[,5])
我得到找到最小值的索引。
[1] 20
现在,如何提取满足相同条件的列的所有索引?也许作为一个列表。
which(xdata[ , 5] == min(xdata[ , 5]))
将工作(它返回一个向量)。
如果要将索引作为列表:
as.list(which(xdata[ , 5] == min(xdata[ , 5])))