Select mutilple columns in data.table
dt is a data.table with multiple columns (variables), if we want to select many columns in one go, we could do this:dt[, columnA:columnD].
Also, we could delete multiple columns with -or !:dt[, -(columnA:columnD)], dt[, !(columnA:columnD), note that the column names should be in brackets ().

浙公网安备 33010602011771号