I have two data sets. Lets call them Master data and Using data. I merged the using data into the master data using 3 keys. I included the all=TRUE argument to keep all merged and non-merged observations
merged_data <- merge(dataset1, dataset2, by=c("key1","key2","key3"), all=T)
Now my question. How do I get information on whether a non-merge happened in Master data or the Using data? Ideally, I want a column that has value
1) 1 if non merge happened due to Using data 2) 2 if non merge happened due to Master Data 3) 3 if Successful Merge!!
Thanks, Kedar