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.
特定の行名に対応する行のインデックス番号をどのように決定できますか? 行名のベクトルがあり、これらを使用して、行列内の対応する行インデックスのベクトルを取得したいと考えています。
row()とを試しas.integer(rownames(matrix.object))ましたが、どちらもうまくいかないようです。
row()
as.integer(rownames(matrix.object))
試してくださいwhich:
which
which(rownames(matrix.object) %in% c("foo", "bar"))