Hi I want to add rows from one dataframe to another dataframe using R.
I have one dataframe DATA1 which has some missing ID and Data2 has all the ID's I want to replace the DATA2 frequency column with DATA1 values for all the matching ID's. and I want OUTPUT dataframe as my Output.
Data1
ID frequency
1 1
2 7
3 11
5 4
DATA2
ID frequency
1 0
2 0
3 0
4 0
5 0
6 0
Output
ID frequency
1 1
2 7
3 11
4 0
5 4
6 0
DATA2[match(Data1$ID, DATA2$ID), 'frequency'] <- Data1$frequencyDATA2, not create a newOutput.