join two dataframes but match on two columns in r

main.r
# Assuming df1 and df2 are the two dataframes you want to join
# and you want to match on columns 'col1' and 'col2'

merged_df <- merge(df1, df2, by.x = c("col1", "col2"), by.y = c("col1", "col2"))
198 chars
5 lines

related categories

gistlibby LogSnag