Example
set.seed(2016)
dt <- data.table(
Grp = sample(1000, 1000000, replace=TRUE),
Date = as.Date("2016-1-1") + sample(365, 1000000, replace=TRUE)
)
dt <- unique(dt)
dt[order(Grp, Date)]
Grp Date
1: 1 2016-01-02
2: 1 2016-01-03
3: 1 2016-01-05
4: 1 2016-01-06
5: 1 2016-01-07
---
341526: 1000 2016-12-27
341527: 1000 2016-12-28
341528: 1000 2016-12-29
341529: 1000 2016-12-30
341530: 1000 2016-12-31
How do I know which (if any) groups share the exact same set of dates? I guess I can dcast
the data and then search for matching rows, but is there a better way?