I need some help in R. I want to find which brand appears in every ID. My data contains three tab delimited fields, lets call them ID (which identify a person), time, brand:
ID time brand
01 1111 BMW
01 1112 BMW
01 1113 Audi
01 1114 Mercedes
02 1115 Audi
02 1115 Cadillac
02 1116 BMW
03 1117 Acura
03 1117 Audi
03 1117 BMW
03 1118 Mercedes
.......
According to the data, therefore, the brands that is common to all IDs are BMW and Audi. Time field is not always unique. However since I have many more records, I can't be sure if there is a common brand to all the IDs. In which case I want to get a rank of what brand appears in most ID.
I have many unique IDs and brands, so I can't use the explanations here How to find common elements from multiple vectors?
I would like to know how to do it in R. Thank you.