My colleague and I are collecting data on separate files and we want to reconcile the data. Our data files look like so:
df1 = data.frame(Id = c(1:5), Score= c(10,NA,4,NA,3))
df2 = data.frame(UserID= c(1:5), Result= c(NA,8,NA,3,NA))
What is the simplest way to merge the two to form the following dataset to attain the following result?
df3 = data.frame(Id= c(1:5), Score= c(10,8,4,3,3))
Changing column names and using merge() don't seem to work which is what I had hoped.
Any suggestions? Would the quickest to be run a for loop across both datasets?