I want to find the number of matches based on ID of unique matches within multiple data.frames
Data looks like this:
df1: KeyID
x
x
y
y
z
df2: KeyID
x
x
x
z
z
df3: KeyID
x
y
y
z
I want to count the number of unique matches between data frames.
output would look like this: 2
Since x and z are the only matches between the two sets.
I have done this but want to know if there is a faster way:
df1.2 <- df2[df2$KeyID %in% df1$KeyID,]
length(unique(df1.2$KeyID))
Any thoughts?