I have two data frames in R, df1 and df2, and I want to join them in ways similar to SQL joins:
Inner join: only rows with matching keys in both data frames.
Outer join: all rows from both data frames, matched where possible.
Left join: all rows from df1, with matching rows from df2.
Right join: all rows from df2, with matching rows from df1.
How can I do these joins in R using these two data frames?