I'm trying to use dplyr's full_join
to combine two data.frames, for example:
col1 = 'b'
col2 = 'd'
df1 = data.frame(a = 1:3, b = 1:3)
df2 = data.frame(a = 1:3, d = 1:3)
full_join(df1, df2, c('a' = 'a', col1 = col2))
but it returns
Error:
by
can't contain join columncol1
which is missing from LHS
I'm looking for an output similar to
merge(df1, df2, by.x = c('a', col1), by.y = c('a', col2))
a b
1 1 1
2 2 2
3 3 3