如何在R中找到数据框的几列之间的交集?

时间:2018-05-20 21:56:30

标签: r intersection

假设我有5列,C1,...,C5定义为:

df<-(C1,C2,C3,C4,C5)

C1 =("Groucho", "John", "Adam", "Mouse", "Harpo", "Zeppo") 
C2 = ("Tom", "William", "Robert", "Julie", "Smith", "Groucho", "Harpo", "Zeppo") 
C3 = ("Harpo", "Groucho", "Jerry", "Duck", "Mickey", "Harpo", "Zeppo")
C4 = ("Seth", "Zeppo", "Groucho", "Harpo")
C5 = ("Groucho", "Harpo", "Zeppo", "Sam")

我正在使用R,我想找到这五列之间的交集(我知道它们是水平写入的,就像行一样,但它们是列)。我在这里找不到类似的问题,“intersect”命令只适用于两列。

任何提示?

0 个答案:

没有答案