I have a situation like this:
DF1
COL1 COL2 COL3 ... a b c b d b f e a g m f
DF2
COL
a
b
c
d
e
f
g
h
i
l
m
n
o
I would like to match each column of DF1 with the only one column of DF2 and score how many occurrence of DF2 are in each column of DF1. How this can be done?
Thanks in advance,
E.
Here’s a couple of guesses:
If DF2 is a data.frame as seems likely given its name then you need to do this:
(Edit note: added quotes around the
%in%and ‘[[1]]’ to return the first and only column of DF2 as a vector rather than a list.)