Check out example codes for "r merge inner join". It will help you in understanding the concepts better.

Code Example 1

merge(x = df1, y = df2, by = "id", 
      all.x=TRUE)[,c("df1_var1", "df1_var2", "df_2var_1")]

Learn ReactJs, React Native from akashmittal.com