Let say I have a data table,
dt = data.table(matrix(1:50, nrow = 5)); colnames(dt) = letters[1:10]; > dt a b c d e f g h i j 1: 1 6 11 16 21 26
Here is a workaround with cbind and two or more selections.
cbind
cbind(dt[, .(a)], dt[, c:d]) # a c d # 1: 1 11 16 # 2: 2 12 17 # 3: 3 13 18 # 4: 4 14 19 # 5: 5 15 20