Thank you in advance for your help.
I have a baseline dataset of around 30000 individuals. Each individual has a unique ID number. I also have a follow-up dataset with the same people, with maybe 2000 individuals lost to follow-up. I'm trying to merge these datasets, matching the data from both datasets for each ID number. For individuals who have been lost to follow-up, I would like to keep them in the merged dataset, but their row would probably need to contain a bunch of NAs since outcomes couldn't be measured in the follow-up dataset.
Is there a way in R to go about this?
(As a relatively new R user, I don't really know how to even begin approaching this problem. I have a feeling I'd need to use dplyr, but matching individuals from two datasets according to their ID and generating NAs for those who were lost to follow-up are beyond me. Any help or hints would be appreciated.)