Submitted by: Matt Dowle; Assigned to: Nobody; [R-Forge link](https://r-forge.r-project.org/tracker/index.php?func=detail&aid=2607&group_id=240&atid=975) ``` S require(data.table) DT = data.table(a=1:9, grp=1:3) DT[ , keep := c(rep(FALSE, .N-1), TRUE), by = grp] DT[(keep), keep := NULL][] # ignores keep DT[, keep := c(rep(FALSE, .N-1), TRUE), by = grp] DT[keep==TRUE, keep := NULL][] # ignores keep DT[, keep := c(rep(FALSE, .N-1), TRUE), by = grp] DT[(keep)][, keep := NULL][] # works ```