[R] merge

n.vialma at libero.it n.vialma at libero.it
Fri Apr 16 14:00:09 CEST 2010


I have a problem with the merge command.
I have to merge two dataframe that looks like the following example:

CODPROD       N1           N3           N4
23                       3               55                 4
24                       5              67                36
25                      3               73                 24



second data frame


CODPROD                  N1              N2       
30                                   34               45
45                                   0                    78
65                                    0                    56


The result should be:

CODPROD                 N1       N2         N3            N4
23                                 3           NA        55            4
24                                 5           NA        67           36
25                                 3           NA        73           24
30                                 34         45          NA           NA
45                                  0          78          NA           NA    
65                                  0           56          NA            NA

Anyone knows how to do it??



More information about the R-help mailing list