I have two data.frames. For examples sake let's say they look like this:
df1 <- data.frame(x=rep(letters[1:26], 16))
df2 <- data.frame(y=letters[1:4])
What I would like to do is subset 'df1' to contain the rows whose first column value matches any value within the first column of 'df2'.
Now, I've tried:
subset(df1, df1$x == df2$y)
But this tells me that I need equally sized data.frames. Thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…