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
You're looking for intersect and setdiff:
intersect
setdiff
term.intersect <- intersect(termlist[1,], termlist[2,]) term2.diff.term1 <- setdiff(termlist[2, ], termlist[1, ])