I have two dataframes like below that shares the column names but information can be conflicting. (First dataframe has more information (ranging 0-5), second has less (range 0 and 4). I merge this two dataframes using dplyr or other R package but what I want to do is to use the information from the first dataframe when available, and when it isn't I use the information from the second dataframe.
For example, two dataframes to be merged are
ID col1 col2 A 0 0 B 3 0 C 5 3
ID col1 col2 A 4 4 B 0 0 C 4 4 D 0 4 E 4 4
What I would like after merging is:
ID col1 col2 A 4 4 B 3 0 C 5 3 D 0 4 E 4 4
C
demonstrates you wanting the data from df1 because it contains the bigger range (5). Is that correct? – Amar