Hello,

I need to combine two data sets into one. For example:

Dataset1:
Code   Cap04
2        120
6          75
7        220
17         4

Dataset2:
Code   Cap08
2        120
7        112
9        190
17         4


I need the dataset to look like the following where it keeps every unique
'code' from both datasets and fills the blanks in both rows with 0:

FinalDataSet:
Code   Cap04   Cap08
2         120       120
6          75          0
7         220       112
9            0       190
17          4          4

Can anyone help me with this please?

Thank you very much!
Johnson

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to