I do have two data sets: data2 and data 3.
The relevant information of the data3 should be added to the respective rows of data2 and the commmon columns in both set are "Inschrijfjaar" and "Leeftijd".
I am using the code:
data4=merge(x=data2,y=data3, by=c("Inschrijfjaar", "Leeftijd"),all.x=TRUE)
A check up gives me:
dim(data2)
525380 5
dim(data3)
1707 7
dim(data4)
5307668 10
So the merge is not done correctly, the dimension of data4 should also be 525380, because it is a left join. So I am getting ways more rows then the left data set. What could be the cause?
I also tried the code:
data4=merge(x=data2,y=data3,all.x=TRUE)