I stole this example from the following post: LINK
set.seed(1) TDT <- data.table(Group = c(rep(\"A\",40),rep(\"B\",60)), Id = c(rep(1,20