# inner join
merge(dt1, dt2, by = c("col1", "col2"))
# left join
merge(dt1, dt2, by = c("col1", "col2"), all.x = TRUE)
# right join
merge(dt1, dt2, by = c("col1", "col2"), all.y = TRUE)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter