Outer join 2 data frames by multiple columns in R

Celine

Could anyone help to explain me this issue. I have 2 dataframes: mail_sent:1901 rows and client_return_race: 1663 rows. I want to merge these dataframes together and all rows in mail_sent should be show.

These 2 dataframes have 3 same column: CLIENT_ID, CAMPAIGN_NAME, TIME. I want to merge 2 dataframes based on 3 same columns above. The below is my code.

The code runs well however, the result of merging (mail_race) is 1663 not 1901. I expect it should show 1901 rows because I mentioned all.mail_sent=all/ all.mail_sent=TRUE in the code. It seems that the merge is inner join not outer join.

  mail_race<-merge(mail_sent,client_return_race,by.mail_sent=c("CLIENT_ID","CAMPAIGN_NAME","TIME"),
             by.client_return_race=c("CLIENT_ID","CAMPAIGN_NAME","TIME")
             ,all.mail_sent=TRUE)
Arun kumar mahesh
Try this one it may help you

mail_race<-merge(mail_sent,client_return_race,all.x = T ,all.y = T)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

R - subtracting multiple columns from multiple columns with 2 data frames

From Java

pandas: merge (join) two data frames on multiple columns

From Dev

pandas: merge (join) two data frames on multiple columns

From Dev

Merging Python data frames on multiple columns with different join types

From Dev

Linq 2 Left Outer Join With Multiple Columns in second one

From Dev

R: Join/merge list of data frames by common columns and appending

From Java

Join 2 data frames by columns when the nr of observations are different

From Dev

How to join data frames based on condition between 2 columns

From Dev

how to extract columns in R to make multiple data frames?

From Dev

Extract columns with same names from multiple data frames [R]

From Dev

how to extract columns in R to make multiple data frames?

From Dev

sql left outer join not working for multiple columns

From Dev

pyspark: merge (outer-join) two data frames

From Java

How to join (merge) data frames (inner, outer, left, right)

From Dev

Merge 2 data frames with indifferent values in columns in R

From Dev

Left outer join on 2 columns not running properly

From Dev

Left outer join on 2 columns not running properly

From Dev

How to join multiple data frames using dplyr?

From Dev

Indexing by multiple criteria between 2 data frames in R

From Dev

Intersecting multiple columns between two data frames

From Dev

Combining multiple data frames with different number of columns

From Dev

Pandas left outer join multiple dataframes on multiple columns

From Dev

R data table outer join by function

From Dev

R data table outer join by function

From Java

R loop through columns in list of data frames

From Dev

R: Subset list of data frames by number of columns?

From Dev

R: Merge two data frames by common columns

From Dev

How to merge multiple data.frames and sum and average columns at the same time in R

From Dev

Removing specific columns from multiple data frames (.tab) and then merging them in R

Related Related

  1. 1

    R - subtracting multiple columns from multiple columns with 2 data frames

  2. 2

    pandas: merge (join) two data frames on multiple columns

  3. 3

    pandas: merge (join) two data frames on multiple columns

  4. 4

    Merging Python data frames on multiple columns with different join types

  5. 5

    Linq 2 Left Outer Join With Multiple Columns in second one

  6. 6

    R: Join/merge list of data frames by common columns and appending

  7. 7

    Join 2 data frames by columns when the nr of observations are different

  8. 8

    How to join data frames based on condition between 2 columns

  9. 9

    how to extract columns in R to make multiple data frames?

  10. 10

    Extract columns with same names from multiple data frames [R]

  11. 11

    how to extract columns in R to make multiple data frames?

  12. 12

    sql left outer join not working for multiple columns

  13. 13

    pyspark: merge (outer-join) two data frames

  14. 14

    How to join (merge) data frames (inner, outer, left, right)

  15. 15

    Merge 2 data frames with indifferent values in columns in R

  16. 16

    Left outer join on 2 columns not running properly

  17. 17

    Left outer join on 2 columns not running properly

  18. 18

    How to join multiple data frames using dplyr?

  19. 19

    Indexing by multiple criteria between 2 data frames in R

  20. 20

    Intersecting multiple columns between two data frames

  21. 21

    Combining multiple data frames with different number of columns

  22. 22

    Pandas left outer join multiple dataframes on multiple columns

  23. 23

    R data table outer join by function

  24. 24

    R data table outer join by function

  25. 25

    R loop through columns in list of data frames

  26. 26

    R: Subset list of data frames by number of columns?

  27. 27

    R: Merge two data frames by common columns

  28. 28

    How to merge multiple data.frames and sum and average columns at the same time in R

  29. 29

    Removing specific columns from multiple data frames (.tab) and then merging them in R

HotTag

Archive