I have a set of columns that each column should contain exactly one distinct value per group. Therefore, if I am looking at just a single group (eg by=byCol) and I subset the data to just those columns (eg .SDcols=colsToCheck) then each given .SD should have only one unique row. (eg 1==nrow(unique(.SD)) )