I have a data frame that contains a large amount of duplicate personal-ids by personnel working at different firms.
I would like to use duplicated for the personal-ids for every different quarter within every different firm.
Basically, I would like R to run duplicated only for the ids within quarter 1 for firm 1, then for quarter 2 for firm 1, then quarter 3 for firm 1 etc. until the codes for firm 1 are done, and then move on to firm 2 where it runs duplicated again for quarter 1 for firm 2 etc.
My main issue is: If person A shows up in multiple different quarters or in multiple firms, the first time his/her id shows up within every quarter/firm should NOT be considered a duplicate value.
Any input would be immensely appreciated and I will make sure to be swift with whatever clarifications may be needed. Thank you.