I have two dataframes:
VESSELNO Equip
12234 503
12234 504
12234 505
12234 506
12231 502
12231 503
12231 503
other dataframe has following columns
VESSELNO Equip
12234 503
12234 604
12234 605
12234 506
12231 602
12231 603
12231 503
I want to calculate count of unique Equip combining both dataframes
We can use data.table
to group by VESSELNO and get the Equip
dt[,paste(Equip,collapse = ","), by = VESSELNO]
How can I then compare unique counts?
VESSELNO Equip
12234 (503,504,505,506,604,605) = 6
12231 (502,503,602,603) = 4