R Script Generator: cases lost in merge
Created by: sjewo
I think there might be a bug in the merge code returned by the R-Script Generator from paneldata.org. The sample is reduced to the cases found in the first tmp_dataset
.
The merge function should look like this, to keep all cases from pfad
:
master <- merge(master, data[["bfhgen"]], by = "bfhhnr", all.x=T, all.y=F)
The argument all.x=T
keeps all cases from pfad
respectively master
and all.y=F
discards any other cases.