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.
Rでは、2つのデータフレームから同一の行名を持つ行をどのように抽出できますか?
ありがとう。SM
d1との2 つのデータ フレームd2がある場合、両方で同一の行名は で与えられintersect(rownames(d1), rownames(d2))ます。したがって、たとえば、存在するd1[intersect(rownames(d1), rownames(d2)), ]行を取得できますd1d2
d1
d2
intersect(rownames(d1), rownames(d2))
d1[intersect(rownames(d1), rownames(d2)), ]