regarding the difference, intersection and union of two vectors

前端 未结 1 2021
庸人自扰
庸人自扰 2020-12-19 19:54

I have a csv file, which has two rows, and each row corresponds to a list of words. I read this csv file into a 2*2000 matrix as follows:

termlist = as.matri         


        
1条回答
  •  被撕碎了的回忆
    2020-12-19 20:44

    You're looking for intersect and setdiff:

    term.intersect <- intersect(termlist[1,], termlist[2,])
    term2.diff.term1 <- setdiff(termlist[2, ], termlist[1, ])
    

    0 讨论(0)
提交回复
热议问题