0

I have two different data frames. Data frame 1 (df_14) which has 14 columns and data frame 2 (df_7) which has 7 columns. I want to compare the first column of df_7 to all the columns of df_14 to see if the elements in the first column of df_7 has anything in common with elements in all the columns of df_14. I'd hope to make a new data frame or table with all the common elements. I haven't used R in a really long time so I'm struggling with this, and any advice would help. Thank you!

  • Welcome to SO, student98! Please make this question *reproducible*. This includes sample code you've attempted (including listing non-base R packages, and any errors/warnings received), sample *unambiguous* data (e.g., `data.frame(x=...,y=...)` or the output from `dput(head(x))`), and intended output given that input. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info. – r2evans Jul 07 '21 at 16:32

0 Answers0