r merge 2 data frames code example Example: r how to merge data frames merge(x = df1, y = df2, by = c("Name_tag1", "Name_tag2"), all = TRUE)