0

I have two data sets df1,df2

> df1
 x1    y1 
  1    5
  1    2   
  1    3     
  1   10

> df2
     x2    y2 
      4    8
      4    7   
      4    9    
      4    3

I want to match y1 in df1 with y2 in df2 ,if there are shared values between them ,I will merge the two data sets
in my EX ,y1 contains 3 and y2 contains 3, so the result will be :

> df3

 x1    y1 
  1    5
  1    2   
  1    3     
  1   10
  4    8
  4    7   
  4    9    
  4    3

the merger should be based the condition (shared values only) between y1&y2 , otherwise no

Noor
  • 365
  • 2
  • 13
  • 1
    Just do `rbindlist(list(df1, df2))` – akrun Sep 06 '17 at 10:53
  • Thanks Akrun. My question about merge the two sets if there are shared values between y1, and y2 columns only, at least one value ,otherwise no. it is simple example but the original data sets contain more 12000 objects for each one of them. – Noor Sep 06 '17 at 11:30

0 Answers0