Quick-Tip: How to Map Merges to Joins in R

Inner join: merge(df1, df2) #optionally add by = “variable”
Outer join: merge(x = df1, y = df2, by = "CustomerId", all = TRUE)

Left outer: merge(x = df1, y = df2, by = "CustomerId", all.x=TRUE)

Right outer: merge(x = df1, y = df2, by = "CustomerId", all.y=TRUE)

Cross join: merge(x = df1, y = df2, by = NULL)

TODO: Add syntax highlighting!